symlinks or permission issue:
https://help.dropbox.com/installs-integrations/desktop/move-dropbox-folder#permissions
Rapid way to "clip" out and insert code.
echo "$(date -Iseconds) WiFi Reset Script" >> /home/pi/wifi_reset.log
Connect using USB TTL adapter (CP2102)
Connections from the USB TTL adapter to the Pi:
GND (ground) > GPIO pin 06 (GND)
RXD > GPIO pin 08 (TXD)
TXD > GPIO pin 10 (RXD)
sudo screen /dev/ttyUSB0 115200
--disk-cache-dir=/dev/null
or
--disk-cache-size=1
(limiting the disk cache to 1 byte)
In Arduino, you can do this with WiFi.mode(x), where x can be WIFI_AP, WIFI_STA, WIFI_AP_STA or WIFI_OFF, for example:
WiFi.mode(WIFI_STA);
will set the ESP into client ("Station") mode.
I also use a little "reset" script in a separate sketch, but I have avoided using persistent...
WiFi.softAPdisconnect();
WiFi.disconnect();
ESP.eraseConfig();
while(1); // deliberately crash
The forced crash is because apparently there is a bug in the SDK firmware / hardware that ESP.restart doesn't always clear things - again this may have subsequently been fixed.
Next time the code comes up I nake sure the following runs:
WiFi.mode(WIFI_STA);
WiFi.setAutoConnect(true);
Because for my project(s) I always want my devices to autoconnect in STA mode (which is the factory-delivered state)
WiFi.softAPdisconnect();
WiFi.disconnect();
WiFi.mode(WIFI_STA);
delay(100);
#define DEBUG
#ifdef DEBUG
#define DEBUG_PRINT(x) Serial.print (x)
#define DEBUG_PRINTDEC(x) Serial.print (x, DEC)
#define DEBUG_PRINTLN(x) Serial.println (x)
#else
#define DEBUG_PRINT(x)
#define DEBUG_PRINTDEC(x)
#define DEBUG_PRINTLN(x)
#endif
#ifdef DEBUG
Serial.begin(9600);
#endif
...
Then you can liberally scatter your code with "DEBUG_PRINT ("I think I'm here");",
all controlled by a simple "#define DEBUG"
Ako je macro definiran kao prazan npr. #define DEBUG_PRINT(x), a pozvan u kodu, samo bude izignoriran.
http://stackoverflow.com/questions/28931195/way-to-toggle-debugging-code-on-and-off
http://arduino.stackexchange.com/questions/9857/can-i-make-the-arduino-ignore-serial-print