Avatar for coyu1314


Member since Jul 2018 • Last active Nov 2018
  • 3 conversations

I am app/web software engineer just got into this IOT. very excited about this Espruino

Most recent activity

  • in ESP8266
    Avatar for coyu1314

    I don't know if the code is working on the esp8266. Can any body share their experience with the esp8266 here?

  • in ESP8266
    Avatar for coyu1314

    thanks for your help. Yeah I can get the that IP via the get request on the server end. but this is more like a passive way of getting the ip. I want to be able to get the ip right in the esp8266 as soon as the public ip is changed and send it right away to the cloud.

    so back to my original question is it impossible to get the external ip from the esp8266?

  • in ESP8266
    Avatar for coyu1314

    I am trying to get the public ip in my esp8266 so I can send it to my remote server(http://xxxxx.com) so I can access my espruino server later remotely. Is there an api to get the public ip? I tried to use wifi.getIP() but it returns the local ip (192.168.x.x) only which is not what I needed.
    I also tried the Ethernet.getIP() but it keep saying Ethernet is not defined. Not sure why. am I doing something wrong on using it?

    Please help thanks.

  • in ESP8266
    Avatar for coyu1314

    I have
    A0 map to NodeMCU.D1(Label D1 on board) => Trig on sensor
    A1 map to NodeMCU.D2(Label D2 on board) => Echo On sensor

  • in Projects
    Avatar for coyu1314

    Thanks for your reply, Ollie.
    Actually, my goal is to make esp8266 as portable as possible. I tried to eliminates all the manual configs that might need on my routers. Just like using a wemo, I never really have to mess with the router setting to get it to work. All I need is to turn it on, login to the wemo and setup the wifi login info and done. this is what I am trying to achieve in this proof of concept design. then expend it from there.

    By the way, I am having hard time to get the external ip(the public ip of my modem). when I do wifi.getIp(), it only returns the local ip(192.168.x.x). How do I get the external ip from esp8266? bcuz I want to get the the real ip and post it to my web server whenever it changes so I can access from outside.

  • in Projects
    Avatar for coyu1314

    Hi all, I just got into this espruino yesterday and I am so excited and loving it. this is amazing. It completely open up my possibility on building cool stuffs that I never thought about. Thanks for building such a great community. Anyway, back to my project. so I am planning to build something like the Belkin Wemo. an advanced ver of the wemo.

    My Goal:
    I want to automate my fish tank on refilling water whenever the water level drops to certain level. I m using one water level sensor, one temperature sensor and two switch to turn on/off the water pump and a heater. and of course the esp8266 board itself.

    Main features:

    1. sends the water level/temperture to my webserver every 30min/hour
    2. monitor the realtime water level and temperature from my browser(phone or app).
    3. be able to turn on/off the water pump from my browser (send a request to my esp8266 from my browser)
    4. when connected to the espruino from broswer, the temperature/water level value update itself on webpage as soon as the actual value changes. Not via refreshing the page manually or doing a pull to the esp8266. I would like the esp8266 push to the browser whenever the value is changed.

    My Roadblocks - I got stuck at 3 main issues. I am not sure what to do here. Hope you have some suggestion for me.

    1. since I don't have a static IP with my home internet, how do I get the correct ip address whenever my ip is changed? because I need to send the new ip address to my server and store it to db so I can send request to back the esp8266 to turn on/off the water pump and monitor the realtime water level/temperature value.

    2. how do I get the realtime temp/water level update by itself without doing a pull from browser? I am guessing I need to use socket right? if so, please provide some reference on this. if not, what would you do to achieve this goal?

    3. How do I update the wifi login info without hard code it to the code using the IDE? I want to be able to update the wifi login info using my phone whenever the wifi password is change. I want to make this board as portable as possible.

    Thanks for reading and Hope you have some tips for me to solve my two issue.
    Thank you.

  • in ESP8266
    Avatar for coyu1314

    Hi all, I am playing with the HC-SR04 on my esp8266 today and found that the outputted cm value doesn't seem correct at all. it looks like this(see below). a very large value returned. btw, I am completely new to this iot. but I did played with the ultrasonic sensor once with the arduino uno a while back and the distance output seems correct. so, my question is that is it possible that there's a bug in the distance calculation? I highly doubt that. but just want to make sure. If not, what am I doing wrong here? thanks in advance

    I used the code straight from https://www.espruino.com/HC-SR04

    output values:

    35964.50877192983 cm away
    144735.33333333340 cm away
    153507.50877193000 cm away
    162278.77192982469 cm away
    171052.05263157916 cm away
    179822.78947368444 cm away
    188593.07017543850 cm away
    197371.64912280708 cm away
    206141.92982456140 cm away
    214913.57894736839 cm away
    223685.52631578940 cm away
    232456.89473684219 cm away
    241229.26315789471 cm away
    249997.29824561413 cm away
    258771.82456140377 cm away
    267546.50877192983 cm away
    276315.40350877214 cm away
    285087.42105263157 cm away
    293859.31578947376 cm away
    302631.43859649135 cm away