[SOLVED] Unable to write data to serial port on pi3
-
Hello everyone,
I'm trying to create a custom controller on a pi 3. I have some really specific need.
I have build
MySensorsusing the following command :./configure —my-debug=enable —my-gateway=serial --my-serial-pty=/dev/ttyGateway --my-serial-is-pty --my-rf24-ce-pin=22 --my-rf24-cs-pin=24 --my-rf24-irq-pin=13Everything is working fine, the radio is working and I can receive data from nodes with a static ID.
What I want to do is to handle ID request from nodes and to simply send data to nodes. The issue is that I can't write to the serial port.When I try to do :
sudo echo "255;0;3;0;4;4" > /dev/ttyGatewayI get : "Permission not granted"
When I do :
ls -l /dev/ttyGatewaylrwxrwxrwx 1 root root 10 mars 4 13:51 /dev/ttyGateway -> /dev/pts/5In principle it should work with no issue, right ?
My question is : How can I send data by writing to the serial port ?
-
Hello everyone,
I'm trying to create a custom controller on a pi 3. I have some really specific need.
I have build
MySensorsusing the following command :./configure —my-debug=enable —my-gateway=serial --my-serial-pty=/dev/ttyGateway --my-serial-is-pty --my-rf24-ce-pin=22 --my-rf24-cs-pin=24 --my-rf24-irq-pin=13Everything is working fine, the radio is working and I can receive data from nodes with a static ID.
What I want to do is to handle ID request from nodes and to simply send data to nodes. The issue is that I can't write to the serial port.When I try to do :
sudo echo "255;0;3;0;4;4" > /dev/ttyGatewayI get : "Permission not granted"
When I do :
ls -l /dev/ttyGatewaylrwxrwxrwx 1 root root 10 mars 4 13:51 /dev/ttyGateway -> /dev/pts/5In principle it should work with no issue, right ?
My question is : How can I send data by writing to the serial port ?
@sapher said in Unable to write data to serial port on pi3:
sudo echo "255;0;3;0;4;4" > /dev/ttyGateway
Try
sudo echo "255;0;3;0;4;4" | sudo tee /dev/ttyGateway > /dev/nullor make yourself superuser:
sudo su echo "255;0;3;0;4;4" > /dev/ttyGateway -
@Yveaux said in Unable to write data to serial port on pi3:
Thank you dear Sir, both of your solution work. Amazing.
I hope this will help others. Cause I can sense that this is pretty basic Linux stuff. But I was stuck for days on that. Thank you :+1:
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login