Coder Social home page Coder Social logo

Problem step 3 Node.js about mkr1000 HOT 19 OPEN

ryanjgill avatar ryanjgill commented on August 29, 2024
Problem step 3 Node.js

from mkr1000.

Comments (19)

RicardoMan avatar RicardoMan commented on August 29, 2024 1

yes, it is working with the //

from mkr1000.

RicardoMan avatar RicardoMan commented on August 29, 2024 1

Hey Men , I Did!

update the firmware and also had to configure the file mkr1000wifi.js (maybe that was the problem)

https://www.arduino.cc/en/Tutorial/FirmwareUpdater

I will continue in the project, thanks buddy

from mkr1000.

RicardoMan avatar RicardoMan commented on August 29, 2024 1

I want to thank you because it works perfect! the only thing I can mention is that the squematic is wrong with the light sensor with the soil moisture sensor.

My last question, if I wanted the temperature in Celsius, what file should I focus on?

The temperature sensor varies greatly in temperature, should I calibrate it?

Thanks again

from mkr1000.

ryanjgill avatar ryanjgill commented on August 29, 2024 1

Awesome. Glad you stuck with it and got it going.

For the temperature change you would need to update the following function in app.js:

// get temperature measurement
function getTemp(tempSensor) {
  return Math.round(tempSensor.fahrenheit - 25)
}

to

// get temperature measurement
function getTemp(tempSensor) {
  return Math.round(tempSensor.celsius)
}

You can then replace all the spots where °F occurs with °C.

Its in a few spots in these javascript files: chart.js, tempDetailChart.js
and in a few pug templates: index.pug and temperature.pug.

As far as the temperature sensor calibration, mine was off by a large amount so I adjusted the value by subtracting 25 to get it closer to the actual temp.

from mkr1000.

ryanjgill avatar ryanjgill commented on August 29, 2024

I was thinking rolling back the node version would help but it looks like all the dependencies are having issues when I change the node versions. It fixes 1 but causes issues with another.

I'm gonna take a look later tonight when I get off work and see if there is anything I can do to get this project back up and running.

from mkr1000.

RicardoMan avatar RicardoMan commented on August 29, 2024

thank you! I will be attentive

from mkr1000.

ryanjgill avatar ryanjgill commented on August 29, 2024

@RicardoMan I've made some changes to the master branch. I was able to get it all working again with the latest updated dependencies. I did end up changing the static ip address since I've updated routers.

I'm using Node v8.16.0.

from mkr1000.

RicardoMan avatar RicardoMan commented on August 29, 2024

thanks for the answer, now I improve everything, the only thing that when I generate the 'npm start' tells me the following:

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

Is there something new that I need to change in the firmdata?

Thanks !!!

from mkr1000.

ryanjgill avatar ryanjgill commented on August 29, 2024

That means the app is not finding the mkr1000 on the local network. To make sure you can connect to your network, you can uncomment the line in standardFirmataWifi sketch that will enable the serial console. In the StandardFirmataWifi sketch in the Arduino IDE you would uncomment this line:

/*
 * Uncomment the #define SERIAL_DEBUG line below to receive serial output messages relating to your
 * connection that may help in the event of connection issues. If defined, some boards may not begin
 * executing this sketch until the Serial console is opened.
 */
#define SERIAL_DEBUG

uncommenting that line allows you to view the console output in the Arduino IDE. I would uncomment that line and leave the static IP address setting in wifiConf.h commented out so it connects to your network and gets an IP address that is free. Then you can use that address as your static ip address and you would have to update the app.js to match your static ip.

You must comment out //#define SERIAL_DEBUG and re-upload the sketch for the app to work.

from mkr1000.

RicardoMan avatar RicardoMan commented on August 29, 2024

apparently it is connected

StandardFirmataWiFi will attempt a WiFi connection using the WiFi 101 library.
Using static IP: 192.168.100.XX
Attempting to connect to WPA SSID: Rye
WiFi setup done
SSID: Rye
IP Address: 192.168.100.XX
signal strength (RSSI): -47 dBm

from mkr1000.

ryanjgill avatar ryanjgill commented on August 29, 2024

perfect, now you can use that as the static ip and make sure to recomment out the serial debug line. You should only need to update it on the line here in app.js to match that ip:

// set options to match Firmata config for wifi
// using MKR1000 with WiFi101
const options = {
  host: '192.168.100.XX',
  port: 3030
}

from mkr1000.

RicardoMan avatar RicardoMan commented on August 29, 2024

yes, modify the app.js with the static ip,

// set options to match Firmata config for wifi
// using MKR1000 with WiFi101
const options = {
host: '192.168.100.XX',
port: 3030
}

but it still says

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

I will try to update my libraries

from mkr1000.

RicardoMan avatar RicardoMan commented on August 29, 2024

What version of the firmata do you have on your arduino?

from mkr1000.

ryanjgill avatar ryanjgill commented on August 29, 2024

its just the standardFirmataWifi sketch from the examples. it has this date in the comments at the top:

Last updated August 17th, 2017

from mkr1000.

ryanjgill avatar ryanjgill commented on August 29, 2024

Did you make sure to re comment out line #define SERIAL_DEBUG in the standardFirmataWifi sketch and reupload to the mkr1000?

it should be //#define SERIAL_DEBUG.

from mkr1000.

RicardoMan avatar RicardoMan commented on August 29, 2024

Well, I could not successfully achieve my goal, I tried many times everything mentioned and I could not connect to the server.

re install the matrix folder again and again, re install node, reset the arduino, update libraries, etc.

anyway I appreciate your support. Thank you.

from mkr1000.

ryanjgill avatar ryanjgill commented on August 29, 2024

Sorry @RicardoMan. I feel like you are really close to getting it going. If you can see that the Arduino is connecting to your network, we just need to get the connection between the node app and the MKR1000 working. You should only need to match that ip for the connection to work.

Some of the problems I've ran across are networks not allowing peer to peer. Some universities and other public routers don't allow you to do peer to peer. If you are at home this probably isn't the problem.

Another problem could be that the Arduino is connecting to a different network than the computer running the Node app?

from mkr1000.

RicardoMan avatar RicardoMan commented on August 29, 2024

if I use a different port? maybe port 3030 has it busy with another virtual machine

from mkr1000.

ryanjgill avatar ryanjgill commented on August 29, 2024

Thats worth a shot, just make sure they match in the wifiConfig.h and the app.js.

from mkr1000.

Related Issues (2)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.