0

I tried to follow the instruction below to send sensor data from my raspberry pi 2 to Azure.

Connect Raspberry Pi to Azure IoT Hub (Node.js)

I connected the sensors to my pi device in a different way. Not sure if this is the issue, but I am able to read sensor data through a python script from my raspberry pi terminal. Then when I tried to

sudo node index.js '<YOUR AZURE IOT HUB DEVICE CONNECTION STRING>'

But received the below error message

{ [Error: , Remote I/O error] errno: 121, code: '', syscall: 'writeByte' }

I have enabled I2C through Raspberry config. And when I checked i2c addresses, as suggested from my search online, it returned nothing. No number value is returned. What does this mean? Is this the problem that caused the error?

0

Usually, Raspberry Pi has only two pins that work with I2C. So if you connected your sensors a different way, which I assume means you used different pins, then the sensor (which I assume is I2C) won't work with standard I2C scripts. Try connecting the sensor to the proper I2C pins (SDA and SCL).

  • Thanks for the response. I tried to switch to GPIO2 and GPIO3, which are the only two I2C on raspberry pi 2, but still get nothing. I'm using DHT11 sensor. – Tracy Yang Mar 13 at 12:55
  • @TracyYang Aha! DHT11 does not use I2C. Could you share your wiring and setup? – scitronboy Mar 13 at 17:05
  • Will do so when I get a chance. Does BME280 have I2C? If DHT11 does not use I2C, is there other way I can send data to Azure? – Tracy Yang Mar 13 at 21:19
  • @TracyYang yes, it doesn't matter what protocol (like I2c) the sensor uses, you just need to be able to get data from the sensor. I'm not familiar with the index.js script you are using, though, but probably you'll need to modify it in order to send different sensor data. Do you understand node.js? – scitronboy Mar 13 at 21:41
  • Not really. I just followed the instructions in the link above. Do you want me to post the index.js? – Tracy Yang Mar 15 at 13:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.