itofficeeu / ito-sensor-node

Examples of how to read out data from sensors connected with I2C, 1-wire and analogue.
MIT License
3 stars 0 forks source link

Dear itofficeeu could you help me? Need sketch for heltec Lora V2 and 1 CH #1

Closed OstertagM closed 4 years ago

OstertagM commented 4 years ago

Dear itofficeeu I found your comment on a other git issue. I have bought two of the Heletec Device V2 one for making a 1 Ch receiver one for a transmitter. But both didn't work. Could you provide me your working a working sketch. Perhaps without your keys. I have tried to use the right pin for lmic lib. But I don't know if my gateway is wrong or my transmitter. I have no TTN gateway in my city. Thanks a lot. I don't know how to contact you.

itofficeeu commented 4 years ago

Hi. I just read you note. Will return with some answer the next days. Regards.

OstertagM commented 4 years ago

Cool thanks I'll wait for it.

itofficeeu commented 4 years ago

Hi! Good you wrote once more. Had forgot about it. Busy. Sorry. Now see this link: https://itoffice.eu/lorawan-from-0-to-100-heltec-wifi-lora-32-v2-as-a-gateway-to-thethingsnetwork/ This could be something you could use. Let me know how this worked in your case.

itofficeeu commented 4 years ago

Hi! How is it going with my proposal?

OstertagM commented 4 years ago

Unfortunately no time to test. But do you have your config files or a complete sketch for me. Do you have a working 1ch gateway and transmitter from this module?

itofficeeu commented 4 years ago

I have had a working 1ch gateway and transmitter from this module. So I now the tutorial works. And if you would look at the description of the video, you would find the link to the code from tutorial. On my page, have I added my comments to the tutorial.

Here the link to the code from the tutorial: https://github.com/vpcola/ESP32SingleChannelGateway

If you want something finished - without working yourself - you would need to pay for it. That is the standard. Help is help, not "do it for you".

OstertagM commented 4 years ago

Hey I have now a working transmitter. Is was very important to uncomment the subband line. Now my Heltec 1ch gateway is resetting every time he received an downlink after the transmitter has sended.

itofficeeu commented 4 years ago

To find the error, can I give you this general advice: Try to comment out the parts of the code you do not need in this second. The idea is in this way to identify the culprit by commenting it out.

Generally in programming: For example, inside a function, if you have 100 lines of code, you would comment out the last 50 lines, and see if the error still pops up with only the first 50 lines running. If you now the first 50 lines are OK, you would comment out only the last 25 lines and check if it runs without problems. - And so on until you know what lines causes trouble. This method divides the place in the code all the time until you find the spot where it fails.

If you have an error message before the reset, then search for that error message in the code. Where the error message is introduced in the program (written into the program), you will be able to find the code that prints it, and the reason in the program it was printed. This could be an if-statement. Analyze the code around this statement then. What leads to printing the error.

Sometimes this isn't applicable, so you would maybe analyze the code for its functionality. That can be a little hard and take some time, but you learn a lot during this time. You will profit from it.

There can be different reasons for the Heltec resetting. Please check that you have filled out the configurations correct. One OF MANY reasons is the Lora-sender hardware settings being wrong in some way. Maybe do you have an sensor attached to the same pins than the Lora-sender hardware, and that hardware makes the error. Or some other software uses the same pins. Disable the software that uses the same pins as the sender - if you have added that software.

You can see what pins the Lora sender hardware is using on this pinout diagram of the Heltec: https://github.com/Heltec-Aaron-Lee/WiFi_Kit_series/tree/master/PinoutDiagram

De-attach all sensors and put in a fake value in the software to send. Remove any soldering leading to components. In reality: isolate the microcontroller from other hardware by putting it on a breadboard or something likely. When you once have the code running here, you can start adding hardware sensors again. One by one.

I can recommend my own hardware for the Heltec WiFi Lora 32 v2. Once the prototyping board, once the extension board: https://itoffice.eu/product/itoffice-eu-prototyping-board-m_v4/ https://itoffice.eu/product/itoffice-eu-extension-board-for-the-prototyping-board-m_v3-m_v4-and-raspberry-pi-gpios/

Videos about them: https://youtu.be/YJwjZOkhdD8 https://youtu.be/8-bIp66ON1I

If you would add some lines of the terminal/monitor from the Heltec resetting, it would maybe give me some hint on your problem. Please do that.

itofficeeu commented 4 years ago

By the way, some pins for the Lora sander have changed from Heltec V1 to V2 .... try to compare the pinout between the V1 and the V2. - Right side of the development board.

OstertagM commented 4 years ago

It is not the transmitter that goes in reset. This is working fine for now. It is the gateway https://github.com/things4u/ESP-1ch-Gateway-v5.0. It receives Masage and when reset. Debug complex. Can you recommend me a other cheap gateway.

itofficeeu commented 4 years ago

You can get a ready-for-running gateway from 69 Euro and upwards: https://www.thethingsnetwork.org/docs/gateways/thethingsindoor/

They give you three places to buy it: https://www.thethingsnetwork.org/docs/gateways/thethingsindoor/#buying-the-things-indoor-gateway

I do not know of cheaper gateways. This one can handle all 8 channels. - Could it be something for you?...

PLEASE be aware of the frequency you are allowed to use in your country, and choose the gateway accordingly.

In the link you gave me https://github.com/things4u/ESP-1ch-Gateway-v5.0 They write under To-DO: "Support for ESP32 (=Heltec)...". That tells me, that it officially isn't supported yet IN THAT CODE.

I do not have time to experiment with the Heltec as gateway until MAYBE at the end of the week. Let me see when we are there how my time is.

If you return to the link i gave you, https://github.com/vpcola/ESP32SingleChannelGateway/tree/master/ESP-sc-gway THERE IS SUPPORT FOR HELTEC V2 as gateway. Why don't you use that code for the gateway?.... Have you tried that?

itofficeeu commented 4 years ago

I have found some other software you could use. This is more or less from Heltec themselves. But I can not see right now, if it is for the GATEWAY OR the NODE?

https://github.com/HelTecAutomation/heltec_lmic

They write: "This repository contains the IBM LMIC (LoraMAC-in-C) library, slightly modified to run in the ESP32 + Arduino environment, mainly fixed for Heltec Automation produced ESP32 + LoRa series products."

So this is directly for the Heltec WiFi Lora 32.

OstertagM commented 4 years ago

I use this now for node thanks.

OstertagM commented 4 years ago

Gateway I will bye the 8ch perhaps. This I saw also and test your suggestion of gateway code. Thank you for your time.

itofficeeu commented 4 years ago

Can I ask what solution you chose?...

Another gateway, or the software I proposed?

OstertagM commented 4 years ago

Yes I had some used the software as you sad before you told me but with some problems. Now I uses b00bl1k/ESP-1ch-Gateway-v5.0 forked from things4u/ESP-1ch-Gateway-v5.0 because this fix my problem. Perhaps I'll by sometime the 8 channel I don't know.