pycom / pycom-libraries

MicroPython libraries and examples that work out of the box on Pycom's IoT modules
330 stars 378 forks source link

lorawan-nano-gateway: Incorrect comment or function called #67

Closed gizmocuz closed 5 years ago

gizmocuz commented 5 years ago

Comment says 'set to blocking', code does otherwise

# make the socket blocking
s.setblocking(False)

See:

https://github.com/pycom/pycom-libraries/blob/c88fd9beef4d0b9c891c796802900fa50943cb73/examples/lorawan-nano-gateway/otaa_node.py#L47

same for 'otaa_node_US915.py'

what shall it be?

danspndl commented 5 years ago

Hi @gizmocuz 👋

I think the code is correct, I'll update the comments to avoid confusion. If you set it to True, it'll block the socket when receiving until something is actually received (this can be avoided with s.settimeout(x)). For the purpose of this example, we might not receive anything and we want to keep trying.

Let me know if you have any questions!