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

platformIO OTA update fails on password containing $@ #1498

Closed
sarming opened this issue Jan 19, 2019 · 1 comment
Closed

platformIO OTA update fails on password containing $@ #1498

sarming opened this issue Jan 19, 2019 · 1 comment

Comments

@sarming
Copy link

sarming commented Jan 19, 2019

Bug description
OTA update via PlatformIO fails on some complex passwords.
After some investigations I believe the $@ combination is to blame.
In the debug output below 123456x$@ becomes 123456x.

Steps to reproduce

$ export ESPURNA_AUTH='123456x$@'
$ echo $ESPURNA_AUTH
123456x$@
$  pio run -e wemos-d1mini-relayshield-ota -t upload
...
Uploading .pioenvs/wemos-d1mini-relayshield-ota/firmware.bin
20:20:13 [DEBUG]: Options: {'esp_ip': '192.168.1.199', 'host_port': 18914, 'image': '.pioenvs/wemos-d1mini-relayshield-ota/firmware.bin', 'host_ip': '0.0.0.0', 'auth': '123456x', 'esp_port': 8266, 'spiffs': False, 'debug': True, 'progress': True}
20:20:13 [INFO]: Starting on 0.0.0.0:18914
20:20:13 [INFO]: Upload size: 468544
20:20:13 [INFO]: Sending invitation to: 192.168.1.199
Authenticating...FAIL
20:20:13 [ERROR]: Authentication Failed
*** [upload] Error 1

Device information

[544809] [MAIN] ESPURNA 1.13.4-dev
[544809] [MAIN] [email protected]
[544809] [MAIN] http://tinkerman.cat

[544809] [MAIN] CPU chip ID: 0x1C1953
[544812] [MAIN] CPU frequency: 80 MHz
[544815] [MAIN] SDK version: 1.5.3(aec24ac9)
[544820] [MAIN] Core version: 2.3.0
[544823] [MAIN] Core revision: 159542381
[544826] 
[544827] [MAIN] Flash chip ID: 0x1640C8
[544830] [MAIN] Flash speed: 40000000 Hz
[544834] [MAIN] Flash mode: DOUT
[544839] 
[544840] [MAIN] Flash size (CHIP)   :  4194304 bytes / 1024 sectors (   0 to 1023)
[544845] [MAIN] Flash size (SDK)    :  4194304 bytes / 1024 sectors (   0 to 1023)
[544855] [MAIN] Reserved            :     4096 bytes /    1 sectors (   0 to    0)
[544859] [MAIN] Firmware size       :   468544 bytes /  115 sectors (   1 to  115)
[544866] [MAIN] Max OTA size        :  2670592 bytes /  652 sectors ( 116 to  767)
[544873] [MAIN] SPIFFS size         :  1015808 bytes /  248 sectors ( 768 to 1015)
[544881] [MAIN] EEPROM size         :    16384 bytes /    4 sectors (1016 to 1019)
[544888] [MAIN] Reserved            :    16384 bytes /    4 sectors (1020 to 1023)
[544896] 
[544896] [MAIN] EEPROM sectors: 1019, 1018, 1017, 1016
[544901] [MAIN] EEPROM current: 1019
[544904] 
[544905] [MAIN] EEPROM:  4096 bytes initially |   750 bytes used (18%) |  3346 bytes free (81%)
[544915] [MAIN] Heap  : 36192 bytes initially | 14072 bytes used (38%) | 22120 bytes free (61%)
[544923] [MAIN] Stack :  4096 bytes initially |  1264 bytes used (30%) |  2832 bytes free (69%)
[544930] 
[544931] [MAIN] Boot version: 31
[544934] [MAIN] Boot mode: 1
[544937] [MAIN] Last reset reason: Software/System restart
[544942] [MAIN] Last reset info: Fatal exception:0 flag:4 (SOFT_RESTART) epc1:0x00000000 epc2:0x00000000 epc3:0x00000000 excvaddr:0x00000000 depc:0x00000000
[544956] 
[544957] [MAIN] Board: WEMOS_D1_MINI_RELAYSHIELD
[544960] [MAIN] Support: ALEXA API BROKER BUTTON DEBUG_SERIAL DEBUG_TELNET DEBUG_WEB DOMOTICZ HOMEASSISTANT LED MDNS_SERVER MQTT NTP SCHEDULER TELNET TERMINAL THINGSPEAK WEB 
[544976] [MAIN] WebUI image: SMALL
[544978] 
[544979] [MAIN] Firmware MD5: 79f1657c7d417d24518307655b35792a
[544985] [MAIN] Power: 2718 mV
[544988] [MAIN] Power saving delay value: 10 ms
[544991] 

Tools used

  • macOS 10.14.2
  • zsh 5.6.2 (also reproducible with bash 5.0.0)
  • PlatformIO, version 3.6.3
@mcspr
Copy link
Collaborator

mcspr commented Jan 20, 2019

platformio internally calls ota command by using 'sh', so shell expansion does happen eventually.
dumb workaround: export ESPURNA_AUTH=\''password$@'\'

maybe it is better to be handled in extra_script by automatically single-quoting it

@xoseperez xoseperez added this to the 1.13.5 milestone Jan 20, 2019
@xoseperez xoseperez added the bug label Jan 20, 2019
@xoseperez xoseperez modified the milestones: 1.13.5, 1.15.0 Feb 24, 2019
mcspr referenced this issue Jul 11, 2019
- update file paths: .pioenvs -> .pio/build, .piolibdeps -> .pio/libdeps
- modify envs to use common settings
- enable shared libs in travis and ota scripts
@mcspr mcspr closed this as completed in 46f4eef Sep 2, 2024
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

3 participants