I have a task to connect PROFIBUS (field bus technology by Siemens) to my Raspberry Pi. I need to make my Raspberry pi as a master and others devices as a slaves.
Let me know if you have any idea about how to make this connection. I am totally new in this topic and have no idea about this.
You might have a look at this project: https://bues.ch/cms/automation/profibus
When I understand it correctly, Profibus (Modbus) ist implemented by RS-485, that is not directly supported by the Raspberry Pi GPIOs.
You have to buy an extra shield or an USB to RS-485 Adapter.
There is also a library to send/receive data using modbus-protocol:
http://libmodbus.org/
Related
I have been trying to find a way to get a Raspberry Pi to communicate with a Nayax VPOS system and have been told that this would require an MDB to USB interface. Is this true and if so, what would be required on the software front to make the communication work?
I have been looking into MDB protocol and have some knowledge but I am not sure how to implement this on Raspberry Pi, any help or guidance would be appreciated.
I'm a totally newbie and interested in physical programming like raspberry pi's. Is there any way to get the data which is intended to go to a "USB to TTL converter device" through USB(e.g. the output of a flashing software), read it and convert it to TTL using Python or C language? I mean something like:
Compiler --> avrdude --> Ethernet port of the compiler host PC --> Ethernet port of a Raspberry Pi --> Pins of the Raspberry Pi --> avr microcontroller
My question is about the code which I should run on the Raspberry Pi to do all the work required on that side. I'm guessing in this specific example it's possible to install avrdude on the Raspberry Pi and pipe the compiled code from the PC to the avrdude on the pi but I'm looking for a general solution that can be used with all microcontrollers, essentially turning the Raspberry Pi into a transparent, Ethernet connected, USB to TTL converter, either existing libraries or directions to how to write such code and where to read the documentations.
Edit1: There's a C language library called pigpio already installed on the Raspberry Pi OS and it can output UART. But I don't know how to read the USB data coming to the Raspberry Pi through its Ethernet port and convert it to UART data.
Edit2: I Changed USB port to Ethernet port since you can't connect two computers directly through USB. The data coming from the PC is still intended for USB to TTL converters since that's how avrdude and similar softwares are written(I guess it'll be "USB over Ethernet").
I am currently working on a project that involves communication between a PLC , Raspberry Pi 4 and a BMS (Battery Management System) system on a battery.All three device use RS485 for communication using minimalmodbus via python on the RPI.
The Raspberry pi has a generic CAN/RS485 HAT (similar to this : https://www.waveshare.com/rs485-can-hat.htm)
Currently I am able to communicate with the PLC to receive and send data from the RPI with the PLC as a master and the RPI as a slave.
As per my understanding , in order to read data from the BMS using the Pi, the RPI has to be a master. But in this case, as the RPI is a slave to the PLC, and the PLC cannot be used to read data from the BMS.
I would like to know if it is possible for the RPI to function as a Master to the BMS when being a Slave to the PLC at the same time ?
Assuming that it is possible able to connect another RS 485 HAT to the same RPI and run separate scripts for each HAT.
I'm working on a project where I need two raspberry pis to communicate and the ethernet port is not free, I'm not allowed to make any changes to the GPIO pins, and I'm forced to use the USB port due to hardware considerations. Is it possible for them to communicate using a direct USB cable, or perhaps using two USB-RS232 cables?
Thanks!
Siddharth
I would use the TTL serial pins on the GIO header. See https://elinux.org/images/1/13/Adafruit-connection.jpg
You could create your own simple null modem serial cable - consisting of 3 jumper cables.
Connect pins
6 <--> 6
8 <--> 10
10 <--> 8
If you can't use the GPIO header - you can do a USB to USB connection using USBNET. http://www.linux-usb.org/usbnet/
Is it possible for them to communicate using a direct USB cable, or perhaps using two USB-RS232 cables?
You fail to mention exactly which Raspberry Pi version(s) you are using.
Only the Raspberry PI Zero can be used as a USB Gadget.
Since USB is a master-slave(s) interface & protocol, you cannot simply connect two Raspberry PI 1/2/3 boards together using USB, because that would be a master-to-master connection.
If you look hard enough for a (passive) USB Type A (male) to Type A (male) cable, you can find them, but it's a bogus connection that will not work.
There are active USB host-to-host cables (which contain a shared gadget), but support can be an issue.
You could connect a Raspberry PI 1/2/3 to a Raspberry PI Zero by USB, so long as the Zero's USB port was configured as a USB ACM CDC gadget.
However one simple solution is your alternative of installing USB-to-RS232 adapters to each board. A null-modem cable of three wires would suffice unless you needed hardware flow-control.
An alternative solution is installing USB-to-Ethernet adapters to each board (with static IP addresses, i.e. an ad-hoc connection). This approach provides a much faster connection than an RS-232 link, and is easily utilized by applications.
I want to install MATLAB and Simulink support package for Raspberry Pi. I follow this link to do . I directly connect my laptop with Raspberry Pi using Ethernat cable.
But i didn't get output.
while installing i got error - "Could not detect a Raspberry Pi board on "Local Area Connection". Check your Ethernet connection to Raspberry Pi.
The FDX/LNK/100 LEDs on the Raspberry Pi board should be illuminated.
For network trouble-shooting instructions see http://www.mathworks.com">The MathWorks Web Site"
Can anyone help to solve this problem?
I have also experienced your same issue but after proceeding in this way I solved it.
Before you put the SD card on the Raspberry Pi you need:
power off the Pi
connect the Ethernet cable to the host computer
finally power on the Pi
In addition you may take a look at this troubleshooting guide.
Try the following steps.
1. Open cmd and execute 'ipconfig'
check for a network interface with '169.x.x.x' ip address
If there is one, you could access your Pi via IP 169.254.0.2
If there is none, check if your Ethernet port is enabled and no static IP is configured.
The above steps make sure that your Ethernet port is in proper state.
Repeat the hardware setup with direct connection in the network settings.