LoPy Nano-Gateway
-
@angel-imaz please see my post here:
https://forum.pycom.io/topic/98/lopy-as-lorawan-basestation/20
Our team is working on examples and there will be in the docs soon. If you need a HTTP client library, please try this one out: https://github.com/micropython/micropython-lib/tree/master/http.client
-
Ditto. What's LoRa without a gateway!? Time for proper documentation on this product feature.
-
Hello.
It would be great to get a proper tutorial on how to do a http request from a lora through a nano gateway.
I backed you in KS because you made a big point of making this possible. It is great to have the device. But really not very user friendly at all. And you are already launching a new one with more radios. Yet you still have not make LoPy work as promised.
Please help!
Thank you!
Angel
-
This is extremely exiting, since I have exactly the same hardware! I hope I'll have some time this month to test your code, @Xykon, and make the bits fly.
-
After quite a bit of trial and error I have managed to get the LoPy to "talk" in P2P mode to a Dragino LoRa/GPS hat (which uses the same SX1272 chip that's in the LoPy.
For anyone interested I have posted some more details here and have made the source code for the LoPy and Raspberry Pi available on github.
-
You might also have a look at these resources:
- An extensive discussion on the TTN forum
- An article by Linklabs stating the issues especially for LoRa (they do have competing products, but the reasoning seems sound)
-
@kgadeshi with the RSSI of the received packet and knowing the amount of power that was used to transmit it, the free space loss formula can be used to estimate the distance between the 2 nodes.
-
time measurement should be then in nanoseconds i believe
you can send signal and wait for receive and calc distance divide time by two ;-)
-
@Roberto
Is it possible to implement some kind of ranging algorithm in LoRa. So that one can calculate the distance between the nodes to the gateway or something along those lines? Thanks.
-
Hi @brotherdust,
The watchdog problem was fixed in the new firamware version, please download it since this is important not only for the nano-gateway but for all the other apps you want to run as well.
The update is here:
https://www.pycom.io/support/supportdownloads/Please test the nano-gateway code afterwards to make sure that everything is working
Best,
Roberto
-
Hi @brotherdust
This issue is not related to the nano-gateway code, it is a known issue regarding the WatchDog and we will be addressing it soon, i'll keep you informed with a fix for this.
-
Hi @gertjanvanhethof
I'll provide a new code example this week on the blog section that might answer your question.Best,
Roberto
-
Hi @brotherdust,
A CRC its not required as it is included in the protocol. You can still implement it if you want. I tried this in a project we have running just to make sure and all the checksums are positive
-
@Roberto @daniel I have the same issue as brotherdust.
Reading up about the 'struct' I found a commen that in ypython the name if the module has changed - refer point 11:
https://github.com/micropython/micropython/wiki/Differences
I changed the code to reflect 'ustruct' and the LoPys no longer crash and I can still see them with my Pymakr - however they are not connecting..
-
@Roberto, both the gateway and node code crash my LoPy's. I did a factory reset on them thinking maybe my code was involved. Nope.
Here's the console log:
rst:0x7 (TG0WDT_SYS_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT) configsip: 0, SPIWP:0x00 clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00 mode:QIO, clock div:2 load:0x3fff9010,len:8 load:0x3fff9018,len:312 load:0x40078000,len:2348 ho 0 tail 12 room 4 load:0x4009f000,len:1364 entry 0x4009f2f8 ˜øXTAL 40Mep 26 2016 22:32:10 frc2_timer_task_hdl:3ffda618, prio:22, stack:2048 tcpip_task_hdlxxx : 3ffdede4, prio:18,stack:2048 phy_version: 123, Sep 13 2016, 20:01:58, 0 pp_task_hdl : 3ffea6b4, prio:23, stack:8192 mode : softAP(24:0a:c4:00:b6:41) dhcp server start:(ip: 192.168.4.1, mask: 255.255.255.0, gw: 192.168.4.1) dhcp server start:(ip: 192.168.4.1, mask: 255.255.255.0, gw: 192.168.4.1) MicroPython d78a5a3 on 2016-11-05; LoPy with ESP32 Type "help()" for more information. >>> paste mode; Ctrl-C to cancel, Ctrl-D to finish === import socket === import struct === from network import LoRa === === # A basic package header, B: 1 byte for the deviceId, B: 1 byte for the pkg size, %ds: Formated string for string === _LORA_PKG_FORMAT = "!BB%ds" === # A basic ack package, B: 1 byte for the deviceId, B: 1 bytes for the pkg size, B: 1 byte for the Ok (200) or error messages === _LORA_PKG_ACK_FORMAT = "BBB" === === # Open a LoRa Socket, use rx_iq to avoid listening to our own messages === lora = LoRa(mode=LoRa.LORA, rx_iq=True) === lora_sock = socket.socket(socket.AF_LORA, socket.SOCK_RAW) === lora_sock.setblocking(False) === === while (True): === recv_pkg = lora_sock.recv(512) === if (len(recv_pkg) > 2): === recv_pkg_len = recv_pkg[1] === === device_id, pkg_len, msg = struct.unpack(_LORA_PKG_FORMAT % recv_pkg_len, recv_pkg) === === # If the uart = machine.UART(0, 115200) and os.dupterm(uart) are set in the boot.py this print should appear in the serial port === print('Device: %d - Pkg: %s' % (device_id, msg)) === === ack_pkg = struct.pack(_LORA_PKG_ACK_FORMAT, device_id, 1, 200) === lora_sock.send(ack_pkg) === Task watchdog got triggered. The following tasks did not feed the watchdog in time: Tasks currently running: CPU 0: MicroPy Aborting. Guru Meditation Error: Core 0 panic'ed (Unhandled debug exception) Register dump: PC : 400e7078 PS : 00060036 A0 : 800f221e A1 : 3ffd5440 A2 : 0000000a A3 : 0000000a A4 : 00000004 A5 : 00000000 A6 : 00000000 A7 : fffffff8 A8 : 00000000 A9 : 3ffd53b0 A10 : 00000000 A11 : 3ffdd923 A12 : 3ffd537f A13 : 00000030 A14 : 00000000 A15 : 00000200 SAR : 00000013 EXCCAUSE: 00000001 EXCVADDR: 00000000 LBEG : 4000c46c LEND : 4000c477 LCOUNT : 00000000 CPU halted.
-
@gertjanvanhethof said in LoPy Nano-Gateway:
Thanks for the answer.
Is it possible to read LoRaWAN data on LoRA level (not WAN level)?
So building micropython code to get the encrypted data and use the network key to decrypt it and the app key to decrypt the app payload myself.
Is this an opportunity?LoRaWAN specification is public, you can decode LoRaWAN packets and if you know the keys you can decrypt. The main issue is the radio layer, you can listen on single frequency and you can decode only a fixed preselected SF.
-
Thanks for the answer.
Is it possible to read LoRaWAN data on LoRA level (not WAN level)?
So building micropython code to get the encrypted data and use the network key to decrypt it and the app key to decrypt the app payload myself.
Is this an opportunity?
-
@gertjanvanhethof said in LoPy Nano-Gateway:
@Roberto Thanks for the example code!
Question: Is there a way to use the LoPy as LoRaWAN Gateway (OTAA or ABP)?
I have a LoRa Node from Elsys (Model ESM5k) which is able to send temperature data.
I can configure key's on this device using a NFC App on my mobile phone.So I want to setup a LoRaWAN connection from that device to the LoPy Gateway.
How can the LoPy being programmed doing this?Is it possible to do this with the LoPy?
You can not make a LoRaWAN GW with LoPy nor any other SX127x cip based bords which can meet the LoRaWAN specification.
-
@Roberto Thanks for the example code!
Question: Is there a way to use the LoPy as LoRaWAN Gateway (OTAA or ABP)?
I have a LoRa Node from Elsys (Model ESM5k) which is able to send temperature data.
I can configure key's on this device using a NFC App on my mobile phone.So I want to setup a LoRaWAN connection from that device to the LoPy Gateway.
How can the LoPy being programmed doing this?Is it possible to do this with the LoPy?
-
There is a CRC used on the physical leyer.