.. module:: cr02_lorawan ******************** 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(drvname=I2C0, addr=8, clk=100000) Creates an intance of the CR02_TTN class. :param drvname: I2C Bus used '( I2C0, ... )' :param addr: Slave address, default 8 :param clk: Clock speed, default 100kHz .. method:: 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. :param appeui: The appeui generated by TTN application :param deveui: The deveui generated by TTN application :param appkey: The appkey generated by TTN application :param 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. .. method:: 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. :param dataToSend: string to be sent to TTN. .. method:: 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. :param sendNumber: number to be sent to TTN.