Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adalogger write to SD card is conflicting with WiFi #2

Open
scott2b opened this issue Mar 14, 2017 · 3 comments
Open

Adalogger write to SD card is conflicting with WiFi #2

scott2b opened this issue Mar 14, 2017 · 3 comments

Comments

@scott2b
Copy link
Member

scott2b commented Mar 14, 2017

Sort out conflict between logger writing and WiFi module. Config read only of the SD card seems to be ok. Worst case if not resolvable: spec out/implement a mechanism for making WiFi logging/SD card logging on a collector either/or

This seems likely due to sharing the SPI. See this thread for more general info on integrating WiFi w/ LoRa feather
https://forums.adafruit.com/viewtopic.php?f=57&t=104164&p=523629&hilit=share+miso#p523629

@scott2b
Copy link
Member Author

scott2b commented Mar 21, 2017

Per discussion here: https://forums.adafruit.com/viewtopic.php?f=57&t=113864&p=569494&hilit=wifi+spi#p569494

Fix seems not to be trivial. Looking at SDFat code, it seems to do a good job of writing CS HIGH after operations. WiFi101 however uses timer interrupts. Thus queueing operations is probably the best bet. This actually seems reasonable given that we want simply to write each log line and post the same data to the API, thus SPI bus management can be handled by function issuing these operations

@scott2b
Copy link
Member Author

scott2b commented Mar 21, 2017

There is some good general info about the SPI bus here http://arduino.stackexchange.com/a/16349

@scott2b
Copy link
Member Author

scott2b commented Mar 21, 2017

After much effort: Unable to get WINC1500 and Adalogger to share SPI bus for logger writes. WiFi does not want to reconnect after losing the SPI. Things tried:
* Setting Chip select pin modes (WiFi CS HIGH during logger write, logger LOW with reset to WiFi LOW after write)
* WIFI_CLIENT.stop() ... begin()
* WiFi.end()
* WiFi.refresh()
* SPI.endTransaction()
* SPI.end() .. begin()
* various time delays

In the end, unable to get WiFi to continue after writing to the SD card. For now settle with incompatibility between logging and WiFi API posts. SD card read for configs still seems to be ok.

We might consider doing a fallback to SD logging if WiFi can't connect -- depending on how reliable we find WiFi API posts to be.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant