khoih-prog / ESP_WiFiManager

This is an ESP32 / ESP8266 WiFi Connection Manager with fallback web configuration portal. Use this library for configuring ESP32 (including ESP32-S2 and ESP32-C3), ESP8266 modules' WiFi, etc. Credentials at runtime. You can also specify static DNS servers, personalized HostName, fixed or random AP WiFi channel. With examples supporting ArduinoJson
MIT License
371 stars 97 forks source link

Invalid Json generated #60

Closed energise closed 3 years ago

energise commented 3 years ago

Describe the bug

Hi! I was looking to use the json interface but found that some of the json that ESP_WifiManager outputs is invalid.

Eg - it outputs on /scan:

{"Access_Points":[{'SSID':'UPC434892', 'Encryption':true, 'Quality':'98'}, {'SSID':'Horizon Wi-Free', 'Encryption':true, 'Quality':'66'}, {'SSID':'vodafone-602D', 'Encryption':true, 'Quality':'32'}]}

This is great except that single quotes aren't allowed in json - only double quotes

https://findanyanswer.com/does-json-allow-single-quotes

Steps to Reproduce

http://192.168.4.1/scan

Expected behavior

valid json returned

Actual behavior

invalid json returned

Debug and AT-command log (if applicable)

Screenshots

image

image

Information

Please ensure to specify the following:

ESP8266 Arduino 1.8.13

Thanks for such an amazing library

khoih-prog commented 3 years ago

Hi @energise

Thanks for your bug report and your encouraging words. The new ESP_WiFiManager release v1.7.1 has just been published, with your Contribution noted in Contributions and Thanks.

Looking forward to receiving more Contributions of yours.

Regards,


Releases v1.7.1

  1. Fix Json bug in /scan. Check Invalid Json generated #60
  2. Fix timezoneName not displayed in Info page.