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.05k stars 109 forks source link

Allow hotplugging of SD cards #91

Open jsalsburg opened 4 years ago

jsalsburg commented 4 years ago

Ordered two LILYGO® TTGO LoRa32 V2.1_1.6. They would message each other just fine. Formatted and inserted a 16 Gig SD card for each. The Web Page/192.168.4.1 would not mount. I tried everything short of re-flashing. After pushing the RESET Button on each, they worked as expected, did not have to push RESET Button again for them to message.

paidforby commented 4 years ago

Hey @jsalsburg yes you definitely need to reboot the TTGO board after inserting the SD card. Ideally, I would insert the SD card with the power off and then power it up with the card inserted. There is probably a way to hot-plug the SD card, I'm guessing it would be as easy as checking if you are able to run sd_card.begin(SD_SCK, SD_MISO, SD_MOSI, -1); everytime through the loop, currently this is done once at startup, in setupSD. Not sure if there would be any drawbacks to do this everytime in the loop, but I guess you could also do it at certain intervals.

Thanks for pointing this out, I'm going to rename this "allow hotplug of SD card" and tag it as an enhancement, since it's not totally necessary for operation.