Using CR02_LoRaWAN Module¶
CR02_LoRaWAN module is dependant on a .hex file which must be uploaded to CR02 via IP01 before the module can be utilized. The file can be found here accompanied with instructions on flashing it to CR02.
Once flashed, CR02 can be used as a node to connect to The Things Network.
class CR02_TTN(drvname=I2C0, addr=8, clk=100000)
Creates an intance of the CR02_TTN class.
- drvname – I2C Bus used ‘( I2C0, … )’
- addr – Slave address, default 8
- clk – Clock speed, default 100kHz
Sends the keys generated by The Things Network (TTN) application to CR02. CR02 then establishes a connection with TTN. Raises an exeption if any error occurs during initialization.
- appeui – The appeui generated by TTN application
- deveui – The deveui generated by TTN application
- appkey – The appkey generated by TTN application
- debug – Set True to view debugging information on CR02. Can only be used with MD03 whereby the serial communication between CW02 and CR02 is seperated.
Sends a string of limit 30 bytes over the I2C bus to CR02. CR02 in turn sends the string to TTN. Exception raised if unsuccessful.
Arguments: dataToSend – string to be sent to TTN.
Sends a number of limit 30 bytes over the I2C bus to CR02. CR02 in turn sends the number to TTN. Exception raised if unsuccessful.
Arguments: sendNumber – number to be sent to TTN.