The code - assuming it supposed to run on EspruinoWifi board - messes with the pins that are used for communication of Espruino with ESP8266. Do not use any pin marked with purple box in EspruinoWifi board reference.
I see that in getA(...) you have an emulation of reading from pins when uri begins with /rand. (I assume /rand is detected and works). This would mean that something else goes high wire.
Doing any read on a pin auto-configs the pin to input an then Espruino is / cannot properly write to ESP8266 anymore (on pin A2, for example). For ADC, use only from pin set B0, B1, A0, A1, A4, A5, A6, A7. A good practice is to config the pins with pinMode(...).
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
The code - assuming it supposed to run on EspruinoWifi board - messes with the pins that are used for communication of Espruino with ESP8266. Do not use any pin marked with purple box in EspruinoWifi board reference.
I see that in
getA(...)
you have an emulation of reading from pins when uri begins with/rand
. (I assume /rand is detected and works). This would mean that something else goes high wire.Doing any read on a pin auto-configs the pin to input an then Espruino is / cannot properly write to ESP8266 anymore (on pin A2, for example). For ADC, use only from pin set
B0, B1, A0, A1, A4, A5, A6, A7
. A good practice is to config the pins with pinMode(...).