I would use remotely a I2C expansion (IO PCF8574) connected to a RPI 192.168.0.10 from a different RPI 192.168.0.11 like the remote GPIO.
I followed the instructions from http://abyz.me.uk/rpi/pigpio/index.html but I'm a newbie and I can't see anything related to "networked" i2c but only local.
I'm Using Python3 on Raspberry Buster
Can someone help me with this solution or proposing different ones?
Thanks in advance for any help
Abartolo
Related
I'm working on an object detection project for IoT using a webcam and servo. In short, when the object detected by the webcam matches the data in the system, the servo will move. Can the webcam be connected to the laptop, and the servo on the Raspberry Pi? So the input is from the laptop and the output is on the Raspberry Pi using pi-gpio (Remote GPIO). How to? Thanks.
This link shows the GPIO Zero library being used with pigpio to allow remote control of the GPIO pins, from either another raspberry pi - or a PC. Once you configure GPIO Zero to use the pigpio library and connect, I believe you can just use the GPIO Zero libraries as per normal to control the Servo. (though I have not tried this myself!)
However I would probably use MQTT to decouple the two systems. If you run an MQTT broker on the Raspberry Pi (eg. Mosquitto) then the webcam software can publish a message to the MQTT broker, and the raspberry pi software can subscribe and act accordingly.
You can also run this with a cloud based MQTT system (eg. HiveMQ) so the Raspberry Pi and the PC with the Webcam don't even have to be in the same location.
A quick way is to use the Python socket library. Both devices need to be connected to the same network, and the sender needs to know the IP address of the receiver.
I'm currently working on a project that requires me to control a step motor using a raspberry pi. I finished the motor control part of the raspberry pi, but I am not really sure on how to continue on the tcp/ip connection part of the project.
I am meaning to connect a client through the tcp/ip connection and letting the client upload a code that lets the client control the motor, in which there should already be custom commands implemented (e.g. "clockwise ": turns the motor a number of steps clockwise. "set 1": sets the gpio pin to 1, and etc.)
I apologize because my knowledge in raspberry pi and tcp/ip connections are really limited.
Can someone point me a way in the right direction? Thanks in advance.
If you are looking for a scripting solution you can do TCP/IP part using ssh. Client can use ssh to log into the RPi and run the commands. It can use scp for pushing updated code/script.
For automating you can look into Pexpect that lets you script your steps.
I want to configure I2C for raspberry pi using PYTHON or last choice C. I have worked on ATMEL micro controller, it provide I2C communication with any device. I want some similar mechanism for raspberry pi. I have following questions:
1. We have to define address of every device in I2C bus. If i want to send some data from ATMEL micro controller to raspberry pi (write data to raspberry pi), what will be the address of raspberry pi or how we can set the address.
2. Is there any interrupt or something like that if we receive some data on I2C bus?
3. Which library will be best for PYTHON or C?
4. Can i write my custom codes for implementing I2C protocol?
Please help.... Thanks in advance..
I suggest you use i2c-dev and i2c-bcm2708 module, where you will have the i2c buses exposed to the /dev filesystem.
$ sudo modprobe i2c-dev
$ sudo modprobe i2c-bcm2708
Now will will have i2c buses exported, list them with
$ ls /dev/i2c-*
Using it is not that simple because it is i2c, it has different protocols and addresses.
If you are going to use it in C, this is the tutorial.
In python, you can install the i2cdev package and use it as this:
from devi2c import I2C
device, bus = 0x42, 0
i2c = I2C(device, bus)
value = i2c.read(1) # read 1 byte
i2c.write(b’some raw data’) # write bytes
i2c.close() # close connection
I am really frustrated and have no idea where to search for an answer.
Currently I am working on a project to detect drowsiness with an ECG device (Zephyr Bioharness 3). The device works but I can't find it with windows (For example like this). I tried several things:
Find the device with my Smartphone -> works
Find the device with an Ubuntu on the same Laptop -> works
Connect directly on Win7 via Bluetooth with this Python Script: Gist -> connects and sends data
Find other Bluetooth devices with my Laptop on Win7 -> Bluetooth radio is dound
COM port for (virtual) serial connection to a bluetooth device (device manager)
What I am trying, is getting this script to work: ZephyrApp. Beside some compatibility problems with QT and serial (which I was able to fix), the programm hangs here protocol.py. I suspect the problems of not finding the device relates to the problems with the program. I know this is very special case, but hope anyone has an idea, how to fix this.
Regards,
paul
EDIT: Another PC with Win7 can't detect the device as well, it seems it is a Windows problem.
The device can't be detected with Win7, but I found a way to connect via bluetooth directly: https://gist.github.com/darkopetrovic/2127217
im working on a project to connect a Pic to a Raspberry pi via uart.
I know they both have uart pins, but I need to connect them via usb, the cable also serves as the power supply for the Pic.
So my question is, is it possible to use python, C# might also be an option with mono, to use an USB port on the Raspberry Pi for UART?
this is a tutorial I found about uart on the Raspberry Pi with Python
a turorial on what is uart
Not possible.
USB uses two 'pins' for transmission using 'differential signaling'.
This means, both pins are used for sending and transmission.
In UART you use one pin for transmission and one for reception.
Without any interface, not possible.