sudomesh / disaster-radio

A (paused) work-in-progress long-range, low-bandwidth wireless disaster recovery mesh network powered by the sun.
https://disaster.radio
1.06k stars 107 forks source link

Fix main.ino Welcome Message, BLE client, OLED client and Console. #56

Closed beegee-tokyo closed 4 years ago

beegee-tokyo commented 4 years ago

main.ino Welcome Message, the datagram.message length was wrong. Simplified the creation of the messages and make sure their length is correct.

BleUartClient fixed. Only small change when creating the datagram (double message ID).

OLED client simplified and fixed.

Console needs more testing. Not sure how it works with different line ends (CR/LF versa LF only).

paidforby commented 4 years ago

Great work @beegee-tokyo ! It looks like this should work. For some reason, I'm having trouble compiling this with platformio. It is suggesting that the LoRaLayer2 and ArduinoJSON libraries cannot be found when compiling the HistoryMemory.cpp and HistorySD.cpp files. See below for the full error message,

Compiling .pio/build/ttgo-lora32-v2/src/history/HistoryMemory.cpp.o
firmware/esp32/history/HistoryMemory.cpp:2:24: fatal error: LoRalayer2.h: No such file or directory

********************************************************************
* Looking for LoRalayer2.h dependency? Check our library registry!
*
* CLI  > platformio lib search "header:LoRalayer2.h"
* Web  > https://platformio.org/lib/search?query=header:LoRalayer2.h
*
********************************************************************

compilation terminated.
*** [.pio/build/ttgo-lora32-v2/src/history/HistoryMemory.cpp.o] Error 1
Compiling .pio/build/ttgo-lora32-v2/src/history/HistorySD.cpp.o
firmware/esp32/history/HistorySD.cpp:4:25: fatal error: ArduinoJson.h: No such file or directory

*********************************************************************
* Looking for ArduinoJson.h dependency? Check our library registry!
*
* CLI  > platformio lib search "header:ArduinoJson.h"
* Web  > https://platformio.org/lib/search?query=header:ArduinoJson.h
*
*********************************************************************

compilation terminated.
*** [.pio/build/ttgo-lora32-v2/src/history/HistorySD.cpp.o] Error 1

When I check their library registry, I'm able to find the libraries. Obviously, LoRaLayer2 is being pulled in successfully by other parts of the code, not sure why the History files are having trouble.

Any ideas, did you make any changes to your platformio file to get these to compile?

beegee-tokyo commented 4 years ago

:tired_face: Differences between Linux and Windows 7. In Windows there is no difference between capital and non-capital letters in filenames.

In HistoryMemory.cpp the include should be

include "LoRaLayer2.h"

instead of

include "LoRalayer2.h"

and in platformio.ini the lib_deps should say ArduinoJson instead of ArduinoJSON

paidforby commented 4 years ago

I see, that would have never crossed my mind, I'm glad you knew the solution. It is compiling for me now.

This all looks great. The only issue I see is that the OLED client does not appear to be displaying messages to the screen on the ttgo-lora-v2 board. Not sure if this is something you didn't do, or if it is a bug. Unless you know a quick solution, I will merge without this being fixed and we can fix it in a later commit or merge.

Thanks for getting almost everything working.

beegee-tokyo commented 4 years ago

OLED client is working fine for me, but I am testing with a display that has a SH1106 chip, not with a SSD1306 chip. But that's just some code lines differences where the include is done and where the display class is declared. The rest is the same. I just looked into the sources and cannot find any reason why it shouldn't work. Did you test with a ttgo-lora-v1 or with a heltec board as well?

paidforby commented 4 years ago

I have only tested with ttgo-lora-v2. The display is working because the client and route numbers are being updated, the OLED client just doesn't seem to receiving messages from the server, I will dig into it a little more, I also see no apparent why it wouldn't be working.

paidforby commented 4 years ago

I haven't made any progress on resolving my OLED issue, I'm going to go ahead an merge this. I'll make a new commit or merge when I finally solve my issue.