-
1Step 1
The build we adopted is pretty simple. I promised to return the Micro:Bit board unharmed if possible, so adopted bolts and nuts to make the connections rather than solder. Edge connectors and breakout boards are now coming available too for your own projects
The design required 5 connections to the Micro:Bit, so the 5 bolt holes on the board satisfied both the minimum requirement and an obsessive need for symmetry and completeness.
Female Dupont headers had one end cut off and were soldered to M3 solder tags to connect to the RN2483 breakout board.
The RN2483 radio module was soldered to the breakout board. A 10uf capacitor and 8 way header were also added. The optional voltage regulator on the breakout board is not required.
The connections are then:
Micro:Bit Pin RN2483 Breakout Pin GND Gnd 3V 3V3 0 RST 1 Rx 2 Tx The following python code needs to be added to the python editor and downloaded:
# RN2483 LoRaWAN from microbit import * def RN2483_Reset(): # Reset RN2483 uart.init(57600,tx=pin1,rx=pin2 ) pin0.write_digital(1) pin0.write_digital(0) pin0.write_digital(1) RN2483_CheckResponse() def RN2483_SendCommand(command): uart.write(command) RN2483_CheckResponse() def RN2483_CheckResponse(): for i in range(100): sleep(100) if uart.any(): break response_string = uart.readline() def RN2483_SendData(data): uart.write("mac tx uncnf 1 ") for char in data: nibble = char >> 4 if nibble > 9: nibble = nibble + 0x37 else: nibble = nibble + 0x30 uart.write(chr(nibble)) nibble = char & 0x0f if nibble > 9: nibble = nibble + 0x37 else: nibble = nibble + 0x30 uart.write(chr(nibble)) uart.write("\r\n") RN2483_CheckResponse() RN2483_CheckResponse() display.show(Image.NO) RN2483_Reset() #RN2483_SendCommand("sys factoryRESET\r\n") RN2483_SendCommand("mac set devaddr 02011E16\r\n") RN2483_SendCommand("mac set appskey 2B7E151628AED2A6ABF7158809CF4F3C\r\n") RN2483_SendCommand("mac set nwkskey 2B7E151628AED2A6ABF7158809CF4F3C\r\n") RN2483_SendCommand("mac set adr off\r\n") RN2483_SendCommand("mac set rx2 3 869525000\r\n") RN2483_SendCommand("mac join abp\r\n") display.show(Image.YES) while True: RN2483_SendData(b"BBC Micro:Bit Data") sleep(60000)
-
2Step 2
The Microbit will initially display an "X", then a tick.
The setup should then be working and can be seen via the TTN API for the given device address
The device address in the following line is specific to this device. Other implementer must get a unique device address from the TTN network and change the line to reflect it.
RN2483_SendCommand("mac set devaddr 02011E16\r\n"
-
3Step 3
Need to add the TTN and back-end steps here
Discussions
Become a Hackaday.io Member
Create an account to leave a comment. Already have an account? Log In.