Avatar for azer

azer

Member since Oct 2016 • Last active Mar 2017
  • 4 conversations
  • 10 comments

Most recent activity

  • in ESP8266
    Avatar for azer

    file converter solved my problem ....

  • in ESP8266
    Avatar for azer

    Hi, forgive me for my bad english.

    I'm using a nodemcu devkit 0.9 with espruino v1.89. When I add these lines, my board seems to crash. I can't get the prompt and i have to disconnect en reconnect the board to usb, then make a reset. If i remove these lines, everything is fine.

    '<script>'+
                'function postForm(e) {'+
                  'e.preventDefault();'+
                  'var mode = document.getElementById("mode").value;'+­
                  'var hostname = document.getElementById("hostname").valu­e;'+
                  'var ssid = document.getElementById("wifiSSID").valu­e;'+
                  'var pass = document.getElementById("wifiPass").valu­e;'+
                  'var data = { "mode": mode, "hostname": hostname, "ssid": ssid, "pass": pass };'+
                  'var xmlhttp = new XMLHttpRequest();'+
                  'xmlhttp.open("POST", "/save");'+
                  'xmlhttp.setRequestHeader("Content-Type"­, "application/json;charset=UTF-8");'+
                  'xmlhttp.send(JSON.stringify(data);'+
                '}'+
    

    This is the memory without these lines:
    ={ "free": 1332, "usage": 368, "total": 1700, "history": 383 }

    So it's not a problem with memory limit. It seems to be a problem with xmlhttp.open, xmlhttp.setRequestHeader and xmlhttp.send. The problem appears just when I add the 3 lines. Any idea ??

    • 3 comments
    • 50 views
  • in JavaScript
    Avatar for azer

    Argg. ok. I'm using nodemcu based on esp8266 for now. I have a lot of difficulties to post JSON data over xmlhttrequest. it seems that the application/json header is not interpreted by the http module.

    Thanks I will try to find another way to post my datas.

  • in JavaScript
    Avatar for azer

    Hi, forgive me for my bad english.

    1st question: is it possible to import in html page an external lib like jquery ? My esp is not connected to internet so I can't load it from an url.

    2nd question: I have found this doc from official espruino documentation (espruino.com/Internet)

    Can I use this code in html client side or it's just for the server side ?

    Thanks in advance for your helps.

  • in ESP8266
    Avatar for azer

    Thanks for all of that. I'll try it this week :)

    • 7 comments
    • 184 views
  • in ESP8266
    Avatar for azer

    Yes it is exactly that. But I don't have any sdcard connected to the esp. The link provided explain how to save data to an sdcard. I just want to save 4 parameters on memory:

    1 - default ssid in ad-hoc mod
    2 - default password
    3 - user ssid
    4 - user password

    If I use the code in link provided, is there a way to save the file in json format in memory of the esp ?

  • in ESP8266
    Avatar for azer

    Hi, please forgive me for my bad english.

    I have several esp8266 running with espruino. All of them are running very well. But I'd like to permit to change the wifi settings over HTTP. I have one page (/) wher eI can put some fields like "ssid name", "ssid password". But I don't know how I can save these values in my program. I think that I have to change my program to get these value in memory, but I don't know if there is the good solution.

    Is someone have an idea ?

    Thanks.

Actions