lnlp / LMIC-node

LMIC-node | One example to rule them all. LMIC-node is an example LoRaWAN application for a node that can be used with The Things Network. It demonstrates how to send uplink messages, how to receive downlink messages, how to implement a downlink command and it provides useful status information. With LMIC-node it is easy to get a working node quickly up and running. LMIC-node supports many popular (LoRa) development boards out of the box. It uses the Arduino framework, the LMIC LoRaWAN library and PlatformIO.
MIT License
218 stars 102 forks source link

Testing Heltec Wireless Stick Lite and TTN-OTAA #16

Closed mitjad123 closed 3 years ago

mitjad123 commented 3 years ago

Hi,

I am not an expert in LoRa, but I did some Arduino, RFM95, TTN Gateway, sensors testing, etc. I bought Heltec Wirelefs Stick lite and I am testing it, trying to connect to TTN via OTAA.

The stick works OK (Chip ID and WiFiScan examples are tested and OK)

I tried Heltect script in Arduino IDE to test LoRaWan - https://github.com/HelTecAutomation/ESP32_LoRaWAN/blob/master/examples/OTAA/OTAA.ino and it works OK, sending data to TTN - Live data (using my payload formater):

16:32:51 Forward uplink data message Payload sensor 0 value 10 00010203 FPort 2 SNR 4 RSSI -105 Bandwidth 125000 ...

I also tested in Arduion IDE the TTN-OTAA example from LMIC library (https://github.com/mcci-catena/arduino-lmic/blob/master/examples/ttn-otaa/ttn-otaa.ino) and it works OK.

Live data (using my payload formater): 17:09:49 Forward uplink data message Payload sensor 8311 value 127748 FPort 1 SNR 9.5 RSSI -86 Bandwidth 125000

When I test LMIC-node script on my Win 10, VisualStudiCode 1.58.2, Platform IO IDE 2.3.2, Lcation Europe, MCCI LoRaWAN LMIC library by IBM 4.0.0 installed, with \Documents\PlatformIO\Projects\HWFLlora.pio\libdeps\heltec_wireless_stick_lite\MCCI LoRaWAN LMIC library\project_config\lmic_project_config.h:

// project-specific definitions #define CFG_eu868 1 //#define CFG_us915 1 //#define CFG_au915 1 //#define CFG_as923 1 // #define LMIC_COUNTRY_CODE LMIC_COUNTRY_CODE_JP /* for as923-JP */ //#define CFG_kr920 1 //#define CFG_in866 1 #define CFG_sx1276_radio 1 //#define LMIC_USE_INTERRUPTS

I get:

LMIC-node Device-id: wireless-sticklt LMIC library: MCCI Activation: OTAA Interval: 300 seconds 000000002826: Event: EV_JOINING 000000003650: Event: EV_TXSTART

000000005873: doWork job started 000000407523: Event: EV_JOIN_TXCOMPLETE 000000462601: Event: EV_TXSTART 000000842883: Event: EV_JOIN_TXCOMPLETE 000000965706: Event: EV_TXSTART 000001367386: Event: EV_JOIN_TXCOMPLETE ...

I change everything needed in \keyfiles\lorawan-keys.h adding \boards\bsf_heltec_wireless_stick_lite.h

My platformIO.ini:

[env:heltec_wireless_stick_lite] platform = espressif32 board = heltec_wireless_stick_lite framework = arduino lib_deps = mcci-catena/MCCI LoRaWAN LMIC library@^4.0.0 lnlp/EasyLed@^1.1.0 upload_speed = 921600 build_flags = -D BSFILE=\"../boards/bsf_heltec_wireless_stick_lite.h\" -D MONITOR_SPEED=9600 -D LMIC_PRINTF_TO=Serial -D USE_SERIAL -D USE_LED

No Activity is detected on my Mikrotik Router as well. It might be that the frequencies are not set right?

Can someone help me detecting, what am I doing wrong?

Thank you Mitja

lnlp commented 3 years ago

You already created issue #15 for this. Don't create a new issue for the same topic (you could have asked to reopen issue #15). I will close this issue and reopen #15 so we can continue there.

I am not an expert in LoRa,

Therefore it is important to exactly follow the well documented steps described in LMIC-node's README.md.

Nowhere does it say that you must make custom modifications to platformio.ini and remove essential parts that are required for proper operation. But that is exactly what you did (twice) which explains why you did not get it working.

I already gave you advice in #15 to use the original platformio.ini included with LMIC-node:

Apparently you have edited the platformio.ini file included with LMIC-node and have removed essential parts e.g. the [common] and other sections. There is no need to remove anything from platformio.ini. Use the original platformio.ini and the problem should be solved.

But you did not follow that advice. Instead you made even more custom changes to platformio.ini which explains why it is still not working.

Just follow my advice previously given and don't make any custom modifications to platformio.ini. Just follow the steps documented in README.md.

If after following (exactly) the steps described in README.md you succeed in getting it working please let me know so I can close issue #15. If you follow the documented steps but then still do not get it working then please continue in #15.