-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
1ch GW for Chirpstack NEtwork Server on RPI4 + Waveshare SX1262 LoRaWAN HAT #17
Comments
Greetings, @d00m178 ! |
@zhgzhg thank you for answer!
so I can see 2 spi devices, but not sure which is mine - which channel and port I need to use in config?
seems it works ok:
Ive changed config to:
but no luck - the same error - chip not found. also - on this LoRaWAN Hat there is switch "On-Off" how to configure it so it will find the chip?
but dont know how to find out to which ones |
also I saw these examples in RadioLib repo (on which this project based on as far I understand): for SX1278 which is mentioned in README of this project:
it also uses CS ( is it the same as NSS pin? ) pin and DIO0, DIO1 pins. but for SX1262 it uses another pins:
and for example there no way to set BUSY pin in config.json for LoRaPktFwrd also there is pinouts for my LoRaWAN HAT: |
ok I have some updates..
and after running LoRaPktFwrd I saw this:
seems it runs ok but fisrt time it showed a lot of some strange UPLink packets errors.. idk what it means.
now I need to know - how to test it in LoRaWAN network? is it possible to add it to Chirpstack as GW? |
it is strange.. sometimes after starting, LoRaPktFwrd shows output like in previous message but sometimes like this one - it continues to print this:
in the README of project there no example output how it should work in normal state.. also I checked Cubecell AB01 with Sender code: but no luck - no activity in output of LoRaPktFwrd.. |
Hi @d00m178 , Also unfortunately, I have not added any LoRaWAN transmit examples, just plain LoRa. The latter can also cause problems with TTN. However RadioLib makes it easier nowadays to work with LoRaWAN, because they include transmission examples. My recommendation is to use them as a basis. Compared to other popular alternatives like Arduino LMIC , the RadioLib is significantly easier to customize. Customization is almost mandatory, because in order to achieve successful up/downlink communication, the trick is to pin your node to work only on the frequency and SF as the gateway works on. (a single channel frequency plan sort of speak) |
@zhgzhg thank you for answer. what about example of "normal" output of LoRaPktFwrd? but for example - today it started and continues to shows these messages:
what it means? also how do you think - is my settings for SX1262 HAT correct or not?
Also - you mentioned some "traffic policies" for TTN servers. I did not changed this part of configuration - so it means that if everything is ok with my setup - I can check the data on some web page on TTN? how to check it? I need to register to TTN and what next? Also - I will check the RadioLib examples, but as I said I already checked LoRaSender example for my Heltec AB01 devices. So because of this I wonder how to check if this LoRaWAN HAT works with this application LoRaPktFwrd. |
Normally in the console logs for the packets you have received, the "Data:" output has to be greater than 0 bytes and when it is a hex dump will be printed right below the packet. In your case the packets contain no data, which is not normal. Also, given the printed time, they seem to be coming in short bursts which is also not the case during a normal operation. Perhaps there's still something wrong with with the wiring to the SX1262 HAT? The RF settings (spreading factor, sync word, preamble length, and frequency) in the gateway must exactly match those set on the CubeCell. On the TTN topic - it seems you haven't gotten to that part yet. This project connects TTN / chirp stack / whatever LoRaWAN server to your LoRa nodes (e.g. cube cell). Those servers have web UI via which you can register and manage your gateways, nodes, and other apps which can consume or send IoT data in any direction. Via the web UI of the LoRaWAN server you can inspect the exchanged data too. |
@d00m178 , I have noticed in your config you are using DIO4 of the HAT as DIO0. This is likely the cause of the issue with empty data being received. From the screenshots of the board it seems to be possible to bridge the real DIO0 to some of the unused GPIO pins of the raspberry hat, and then configure the pin in the config.json accordingly. |
@zhgzhg than you very much for explaining) as for DIO0 - do you mean that I need solder some pin from the chip to the pin on header? there even no info in the datasheet about DIO0: |
Ah, right - the SX1262 doesn't have a pin named DIO0. And for that reason the terminology in the config.json becomes messy, because the project was originally designed for the SX127x modules. So the proper terms in the config json should be:
Thus, in your
Could you please give it a try, @d00m178 ? |
@zhgzhg
but probably you a bit mistyped, it should be:
take a look on gpio output:
so according to pinout of my HAT we have: CS pin - HW 40 - BCM 21 - wPi == 29 - and I suppose that it will be "pin_nss_cs". and then we have last 2 pins that can be substituted instead DIO0 pin: DIO4 pin - HW 31 - BCM 6 - wPi == 22 and I checked both variants for DIO0:
and
Finally config look like:
and with such config output just continues to print every seconds messages with "Data: 0 bytes":
but I have on the same table 2 CubeCell AB01 devices - sender and receiver with such config based on RadioLib:
and their radio-config the same like on my RPI+SX1262 HAT sender: receiver:
and I suppose that LoRaPktFwrd also should print similar output like the CubeCell receiver but it is not.
so this is a big question - how to configure this HAT with your gateway... |
upd: it is also strange - when the sender sends packets every seconds - gw receives every packet. |
Skipping some packets is actually a normal behavior for the gateway - it's a limitation of the software and hardware in that setup. (Even with a real multi-channel gateway this might happen.) |
@zhgzhg - thank you for your help) btw - it is still interesting - why it start to work after changing pins - DIO1 instead DIO0 and BUSY instead DIO1.. and this is interesting also because you advised to do similar thing.. |
hello again @zhgzhg I have some new questions.. long variant: it started but cant join to TTN:
GW config:
and I can see "Receive gateway status" messages in the Live data of Gateway in TTN console. Also another CubeCell AB01 with another RadioLib firmware works and I can see messages from it in the GW output (my screenshots above) So GW works, radio between cubecell and GW also works.. but cubecell with LoRaWAN FW cant join to TTN.. |
Hi @d00m178 , The long version - first you got to adjust the RF frequencies to match your gateway's frequency plan. In your config 868.0 isn't a valid channel. Anything outsite the TTN / ChirpStack / etc frequency plans is likely to be ignored by the server. Then you should try a simple ABP example LoRaWAN_ABP.ino. Once you make it work and you can see the uplinks appearing in TTN's console you should try the LoRaWAN starter example which is actually OTAA. I recommend that particular order because for a successful OTAA the node has to be pinned to the RF parameters the single channel gateway listens on. Otherwise it will pick a channel randomly and the node may not to join the network from the first try. That pinning requires trickery with the frequency plan of the node... |
hi @zhgzhg, I have checked ABP example and it also doesnt work. and this is configABP.h - all KEYs are from TTN Device settings: and modem init in the main program:
and GW settings:
looks like everything is matching but CubeCell output is:
and no output on GW side and TTN shows - Never in the Last activity tab for Device.. |
If you don't see cli logs from the GW, then the node likely transmits on another frequency. Those are defined within the RadioLib's frequency plan RadioLib frequency plan. Also for LoRaWAN the "coding_rate" is usually set to 5. |
I check radio broadcast with my Nooelec RTL-SDR v5 - and I can see signals on 868.1Mhz from CubeCell Device .. but with CR == 5 it doesnt work in the same way - GW log empty while Device is trying to join. Is it possible that my GW somehow works only with devices that work only with RAW LoRa? |
hello!
is it possible to build 1ch GW on RPI4 Ubuntu 24.04 + Waveshare SX1262 LoRaWAN HAT and use it with Chirpstack Network Server for working with nodes based on Heltec Cubecell and RFM95 based nodes?
The text was updated successfully, but these errors were encountered: