(sysname=‘LoPy4’, nodename=‘LoPy4’, release=‘1.20.3.b4’, version=‘v1.11-95ab8f63 on 2021-09-10’, machine=‘LoPy4 with ESP32’, lorawan=‘1.0.2’, sigfox=‘1.0.1’, pybytes=‘1.6.1’)
I went to this page of your tutorial - Building a LoRaWAN Nano Gateway to The Things Network :
to produce this Gateway ID from the board by expanding the WiFi MAC address.
I copied this code :
import ubinascii
wl = WLAN()
print("Gateway EUI: {}".format(binascii.hexlify(wl.mac())[:6] + 'fffe' + binascii.hexlify(wl.mac())[6:]))```
and pasted it into the IDE.
I expected to get the Gateway ID, but I got this response:
```Traceback (most recent call last):
File "", line 1, in
TypeError: object with buffer protocol required```
Can you see if anything is not correctly configured, or is there a simple answer to this question?
From a quick glance, it looks like you have accidentally popped a ‘u’ at the start of the import statement, which should read - ‘import binascii’.
Unfortuntately TTNv2 is being shutdown late this year, and low channel(less that 8) gateways are being depricated from the list, you can read more about the shutdown here.
I’m not certain that these are definitely TTNv3 compatible but definitely worth checking out:
Thanks Liam,
I double checked it and tried pasting it into the Atom console with or without the “u”
and I get the same error.
I also checked the same code on the Pycom page: LoRaWAN Nano-gateway
and they use the ubinascii version, whereas the Core tutorial uses binascii.
Both give the same error message.
It is puzzling because the board is functioning in other modes.
I’m really stumped. I tried posting the error on the Pycom Github page, but no response
from any user.
From there you can construct the EUI yourself but it would be good to see what the cause is. If I remember I’ll have a look around when I bust out my LoPy again.
It looks like somewhere down the line they might have changed the output from the WLAN.mac() function.
What was happening, was the WLAN.mac() function would output a tuple, one for each STA and AP modes, inside the tuple was a bytes array which is now being selected.
I along with the guys at Core would love to see what you come up with, Lovin LoRa atm!!
Thanks Liam! You’re a champ!
Everyone I’ve asked, including guys at our TechSpace couldn’t figure it out.
At least now I can try and stand up a gateway and do some testing.
I’ve watched Core Electronics grow and become a great resource with very helpful staff and nice tutorials, so thanks to you guys !! And convey that to Graham too.