-
Notifications
You must be signed in to change notification settings - Fork 13
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
recommended esp reset #6
Comments
i did a port myself using 3 megabaud bidirectional uart and most of the core & libraries :) |
@JAndrassy , you're right, it's a major issue. I wonder how they sorted it out in original Wifi shield for Arduino. |
esp-m3? Just an idea, I'm able to run Wifiscan.ino ESP demo on the other MCU just by changing the header and enabling the serial port, no constructor needed |
M3: I bought a couple of them, they are based on ESP8285 but they are basically made for serial communication so I could not run the library on them. Just google. The firmware is identical to ESP8266. Regarding the serial communication: I like the master-slave idea, for full duplex we'd need 4 channels. We can't mix commands and data. So it seemed to me that converting the library to serial communication would require constant polling of the ESP and I wasn't quite happy about it. |
oh contrary, data goes in and out both ways i just added yesturday callback queuing support
whats better than a master-slave? multi-master! If you think thats crazy, I even ported over SPIFFS to the host. im able to read/write/create/append files on the ESP’s SPIFFS... from the host! :) |
here i am flooding MQTT server with publishes in 25ms loops while receiving asynchronous UDP packets. async websockets while mqtt publishing, with UDP packets async https://www.youtube.com/watch?v=5H4WNRGchdI&t=7s heck heres another video of me flooding an MQTT server at 0ms tight loops |
Thanks, I will look at it. |
The speed is impressive. I admit, I don't understand the callback stuff you are writing about. |
in serial monitor, you see the data which is from the callback, callbacks are for asynchronous events. lets take the stock ESP callbacks built in, ive ported them to the host. lets say wifi disconnects, or connects, or dhcp fails on connect, an event is fired on the ESP and it calls it’s core implemented callback. what i did basically is i create the identical callbacks, including their function arguments on the host end, and transfer the callback data over as a single payload which immediately is processed |
if your familiar with the websocket callback on the ESP: void webSocketEventServer(uint8_t num, WStype_t type, uint8_t * payload, size_t length) { The exact one is implemented on the host. If you get a websocket text, or message, the ESP handler forwards it to the HOST one instead |
I'd also like to mention no user code is stored on the ESP, ESP.* WiFi.* and libraries (WiFiClient/WiFiClientSecure(Yeah SSL support with bonus of loading certificate from SPIFFS, (from the host))),SPIFFS, EEPROM, UDP, websockets, etc etc etc), the host actually thinks it's an ESP at this point. Sorry no, I did not port over the SDK, that would be overkill :) |
So kind of RPC, then? |
RPC? now im lost :) |
yeah i guess it's similar to that |
@tonton81 you hijacked this issue. will you publish your firmware and library? |
eventually yeah, i already have a thread on a forum regarding the WIP, regarding your reset issue, GOIO15 must be low for a normal boot, which your using for SPI, and since your master doesn’t know if/when the ESP resets, thats where it gets stuck when the master is holding the line HIGH. you have no choice but to have access to reset gpio to reboot it to a known state as explined above. i used to use an additional gpio on the ESP (GPIO16) which would be driven high or low after sketch boot, to let the master know it was booted and ready, or completely lost (bad boot?), which then knew that it must be reset. i no longer do this as i use async uart for synchronization |
@JAndrassy Sorry, I am aware of the OT communication. |
@tonton81 I hade a plan to develop just for fun a proxy/stub/rpc system like you describe, so I am curious |
im not sure on implementation of your idea as im not familiar with that method, but its good to have more ideas to expand it further. regarding my implementation, the functions do nothing but send the payload command, and retrieve the original return, before returning value to user, so the master code is basically, mostly, just uart data, with autosync and crc validations. bringing SPIFFS over was a major bonus. Theoretically the only way to ‘break’ the way the functions work is if the core/library authors decide to change the function overloads to a point where it affects their own users, which, you know, will never happen as no one wants to break an entire user base of people using their code. regardless, adding more methods or modifications is not that hard, but i keep it as transparent as possible to look and act as a real ESP as the objects and functions and callbacks are identical in every way |
@tonton81, you should learn some IT terminology to be able to communicate with other developers :-). |
honestly i never used github so i wouldnt know where to start LOL, your a dev? yeah my lingo is not so good with words because im self taught over the last several years, sorry |
Yes I am a professional developer in Java and hobby developer for Arduino. Start with creating a repo :-). You use Arduino IDE? |
yeah always, and i use teensy mcus |
my sense of direction to a project i started on that thread changed upwards of post #10 and continues to end which is progressing, so i put it aside to work on this as it was more demanding https://forum.pjrc.com/threads/48839-New-project-code-named-teensquitto |
the stale project will be remade in future to allow multi-network mcu controller support over mqtt using the library im working on which gives teensy as much benefits it can from the ESP, it should work on other mcus as well, but, provided the other micros have STL support as the async callback queue system uses std::deque with std::vectors in a push_back push_front scenario in order to keep the workflow solid. functional is also required to be included |
pop_front i mean* |
In development branch there is an implementation of soft reset. I mean reset over SPI. If you'd want to play with it don't forget to check out development branch on the WiFiSPiESP project, too. |
Hard reset implemented in dev-0.2.0 branch by f537249 |
Implemented in 48ea9f3 |
If a new (version of) sketch is uploaded or Serial Monitor resets the Arduino, the esp doesn't know and holds the unused connections.
If esp is reset and the master holds the SS HIGH, the esp doesn't boot (we know why). It is sometimes hard to get out of this state.
I would recommend to WiFiSpi library users to connect the reset pin of esp8266 to some pin of Arduino (level shifted) and add this code to setup() of the sketch before WiFiSpi.init():
or support it in init() with optional espResetPin parameter
The text was updated successfully, but these errors were encountered: