ryanjgill / mkr1000

Plant monitoring system for Arduino MKR1000 challange
30 stars 5 forks source link

I broke it? #1

Closed ghost closed 8 years ago

ghost commented 8 years ago

The program told me to give this to you! please help!

npm-debug.txt

ghost commented 8 years ago

Nope! i fixed that error with npm install, but that generated this error:

Unable to connect!
Please make sure you have the latest StandardFirmataWifi sketch loaded on the MKR1000

I have the sketch loaded onto my arduino too. StandardFirmataWiFiTest.zip

edit: when i try to ping 192.168.1.9, I get no return

ryanjgill commented 8 years ago

Ok it appears that the mkr1000 is having issues connecting to you home network. When you are loading the StandardFirmataWifi sketch, you can uncommit the serial debugger line. That will allow you to see the output in the serial monitor in the Arduino IDE. I have a lil demo of this process in this video Full app install Jump forward to around 10:30.

After you comfirm the mkr1000 is connecting, make sure to comment out that line again and reload the sketch.

ghost commented 8 years ago

I fixed it! It turns out some networks reject 192.168.1.9 as an ip address! What you have to do is get an IP address, not static, and then assign the static IP to the IP you received without static on. DON'T FORGET TO CHANGE THE ADDRESS IN THE J5 FILE TOO!

ryanjgill commented 8 years ago

Nice find @CinnamonDanish, glad you were able to get it working.

ghost commented 8 years ago

It appears that different networks require different IP ranges, is there one ip that will work the majority of the time?

ryanjgill commented 8 years ago

I think it will just depend on the router and what ports are open. If you can connect without using the static ip option in the Standard Firmata Wifi sketch, then you can check the serial monitor and just set the static ip to the one it connects on.

You will need to update the ip address in the JS just as you mentioned earlier.

ghost commented 8 years ago

Is there a way to write the JS so that it scans for the arduino, (i.e. without static IP), and attempts connection on that network?

ryanjgill commented 8 years ago

I was only able to get it to work by hardcoding the ip address and is the reason for using the static ip option in the firmata config.

If you find a way to scan for it or make it more dynamic, please submit a pull request and I'll pull it in.