racky
New Member
Posts: 28
Raspberry Pi: Yes
Other Device: Odroid C2, XU4 and N2, Banana Pi
|
Post by racky on Feb 9, 2020 12:37:47 GMT -8
I wanted to have a internal temperature/humidity sensor (which is included in the Lead Acid SolarMax setup files) and an external AM2315 temperature/humidity sensor outside the box. github.com/switchdoclabs/SDL_Arduino_SolarMAX_LoRa_TxI have modified lines in the INO sketch file from information in the repository below and included my sketch as an attachment. github.com/switchdoclabs/SDL_Arduino_WXLink_LoRa_TxI am getting the error messages you see in the picture for BAD CRC and incorrect byte length of data transmitted. HELP!!! ![]()
|
|
|
Post by SDL on Feb 9, 2020 13:21:44 GMT -8
I can help some!. Load the original sketch back into the Arduino and verify you can still receive the original Link.
Could you post a diff between the original code and your modified code?
BP
|
|
racky
New Member
Posts: 28
Raspberry Pi: Yes
Other Device: Odroid C2, XU4 and N2, Banana Pi
|
Post by racky on Feb 9, 2020 14:40:55 GMT -8
The original and the edited are attached and the following lines are what has changed: 153-154, 167-174, 301-302, 513-514, 770-786
|
|
|
Post by SDL on Feb 9, 2020 15:08:23 GMT -8
Can you receive packets with the original code?
BP
|
|
racky
New Member
Posts: 28
Raspberry Pi: Yes
Other Device: Odroid C2, XU4 and N2, Banana Pi
|
Post by racky on Feb 9, 2020 15:15:08 GMT -8
yes, no problems with original: Attachments:
|
|
|
Post by SDL on Feb 9, 2020 16:23:33 GMT -8
I tried doing a diff with your code and it just detects the whole file. Something with the download I expect.
Would you do this:
diff originalcode.ino yourchangedcode.ino And post the results. Then I can easily look at what you have done.
Thanks!
BP
|
|
racky
New Member
Posts: 28
Raspberry Pi: Yes
Other Device: Odroid C2, XU4 and N2, Banana Pi
|
Post by racky on Feb 9, 2020 16:45:58 GMT -8
I'm running in windows. Here is the fc differences. I am using Notepad++ and the plugin called compare....
|
|
|
Post by SDL on Feb 9, 2020 16:57:38 GMT -8
Ah! Thank you! It made it easy to see what you were doing.
There is only one Aux variable (4 bytes) available in the protocol. You have added two 4 byte variables. This lengthens the protocol message and the receiver code doesn't know what to do with it.
change your program to code both of the variables into one 4 byte variable.
Say something like:
AuxA = int(Temperature*100)+(humdity/100)
That code 10.75 degrees and 39% humidity into 1075.39
Recover it on the other end.
BP
|
|
racky
New Member
Posts: 28
Raspberry Pi: Yes
Other Device: Odroid C2, XU4 and N2, Banana Pi
|
Post by racky on Feb 9, 2020 17:08:08 GMT -8
Is there a way to change the protocol to allow both 4 byte variables to be sent and received?
I want to move on to the next step of SQL retention and Blynk presentation.
|
|
|
Post by SDL on Feb 9, 2020 17:34:33 GMT -8
Sure, but you have to change the decoder to handle the additional bytes. It can be very tricky to get everything all aligned.
BP
|
|