I quite successfully set up my Arduino Leonardo with some sensor and ESP01 wifi module.
I run code based on this link:
where some commands are sent to Serial (Serial Monitor on Arduino IDE software) and some to Serial1 (ESP01).
i sent to ESP via this code command like:
AT+CWJAP=… with ssid and psk
and everything work ok - I have micro web server with info about sensor status but…
i don’t need to see what’s happening on Serial (monitor)
I just want to set up the connection and web server.
well I modified the code and I leave just the code with Serial1.println("…
ok it work but when I switch off all and start without PC connection via USB and opening Serial Monitor - just put power jack to arduino - the web server won’t start up, just the ESP associates with ssid…
Am I thinking and doing something wrong ? I know that I could do it just on ESP but I need also Arduino…
I’ll try on UNO R3 but I’m afraid I’m making something wrong ;(
In attachment - two codes - first longer with output also on serial monitor - it’s work when connection usb to pc is active and second shortened by me - doesn’t work at all ;\
just doesn’t work without USB active to Arduino IDE
I removed it.
also put this code to uno.
it works in the same way.
only when uno is plugged to pc via usb.. no other powering (jack or usb ac/dc) makes web server up. It only associates with ssid..
i need just simple web server who will display values from connected sensors.. :-\
I think you have too many dbgTerminal.doShit() intertwined in code, if that serial buffer blocks, all your execution blocks.
even dbgTerminal.begin(9600) might block if there-s no actual USB line connected.
You need to clean that up and make wrapper functions (or macros) for all dbgTerminal.doSomething() that test if debuging is enabled or not and print/open/do anything with debugging serial port only if it is enabled