Python Forum

Full Version: Serial communications
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Good Evening everyone,

I am hoping that someone will be able to help me kick start a little project I have been asked to create for a friend.
My challenge is to create an interface to control solenoid’s and send and receive commands from a weighing device.
My only issue is I haven’t done any coding/programming since the early 80’s on a BBCB micro...

I would like to use a PI3 as the interface as it has future expansion potential and it has Bluetooth built in and this is how I would like to communicate with the weighhead.

Here is a brief outline of how the script needs to go...

1) it will be triggered/started by a switch being made (through GPIO)
2) when the switch is made the script needs to send {RH} command over BT to the weighhead.
3) when the weighhead receives {RH} it will do it’s thing and reply over BT with [1] or [2] or [3] or a few possible error messages.
4) script needs to read the reply and change the state of GPIO pins dependant on reply ([1]=pin 1 high or [2]=pin 2 high or [3]=pin 3 high)
5) once pin state has been set, script needs to send {RD} over BT to the weighhead, this makes the weighhead record it’s data, it will then reply with some data (this is not relevant to the script however it does confirm that the data on the weighhead has been recorded.

This is just the basic script I need, there are delays and other GPIO pin changes that need to be implemented but that can come later, if anyone can help with the sending and receiving of the commands over BT I would be very grateful...

Thanks in advance

Tom.
Thank you for your reply, I will get reading and see what I can come up with.