Skip to content

CR02_LoRaWAN Module

This is a module for the XinaBox LoRaWAN implementation using CR02 as an I2C slave device with CW02 as its master. CR02 operates in the 868MHz range.

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.

CR02_TTN class

class CR02_TTN

class CR02_TTN(drvname=I2C0, addr=8, clk=100000)

Creates an intance of the CR02_TTN class.

Arguments:

  • drvname – I2C Bus used ‘( I2C0, … )’
  • addr – Slave address, default 8
  • clk – Clock speed, default 100kHz
CR02_TTN.init

init()

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.

Arguments:

  • 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.
CR02_TTN.sendString

sendString(dataToSend="")

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.

CR02_TTN.sendNumber

sendNumber(numberToSend=0)

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.