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


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?

  • The Remote I/O Error indicates to me that you're able to connect to azure, but are erroring out when you're trying to write the data to azure cloud. Are you able to check and verify that the sensor data is correctly being read on the pi ? I'd start there... i.e check what's being sent to Azure and whether the correct data is being sent.
    – anu
    Jul 25, 2022 at 23:03

1 Answer 1


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.
    – ycenycute
    Mar 13, 2019 at 12:55
  • @TracyYang Aha! DHT11 does not use I2C. Could you share your wiring and setup? Mar 13, 2019 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?
    – ycenycute
    Mar 13, 2019 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? Mar 13, 2019 at 21:41
  • Not really. I just followed the instructions in the link above. Do you want me to post the index.js?
    – ycenycute
    Mar 15, 2019 at 13:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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