Picoborg Reverse controlled by serial Term
Forums:
Hi Im playing with communication LoRa modules and Arduino/ESP32 boards I can successfully send messages over a fair distance and read the message on an Arduino IDE serial monitor. I know how to send sensor readings from an arduino to a Raspberry pi over serial and store these. But would like to go further and control my Piborg robot via this method. The messages would be simple left right stop etc. and possibly compass directions.
Is controlling the pico borg in this manner feasable if so could you help?
piborg
Fri, 09/08/2023 - 18:28
Permalink
Controlling PicoBorg Reverse robot from serial commands
Sorry about the slow reply.
Yes, you should be able to do this using a PicoBorg Reverse :)
First you will need to setup the board at the top of your script (change the power settings to match your robot).
I would also suggest having a separate speed value that you can change so you can run the robot slower when testing. You can also use this later as a way to change the speed via serial as well.
Now all you need to do is get your serial commands and change the motor outputs to match. The exact commands will depend on how your motors are wired.
Here is an example assuming:
command
holds the command from the serialbolverk1234
Sat, 02/17/2024 - 16:06
Permalink
Using commands from serial
Hi, Thanks for the above code. I've not had a chance to try it yet as I've been tryig to get my LORA devices to communicate. I have come across Meshtastic which allows text messages to be sent over LORA devices.
The device is ESP32 based, using the serial ouputt I can receive text messages and print them to term on my Rasberry Pi. Unfortunately the Lora device prints diagnostic info along with the name of the Lora device that sent the message (see attached )
If the message is in caps will the PI only use the text message and ignore other info that is printed by serial eg Radio name and Diagnostics?
For example
Rav1: FORWARD
I have attached a sample of the serial output.
I'm also a bit confused as how I get my serial commands ? Is there something I need to add to my imports? Will The Pi automatically use serial input?
Thanks again
John
piborg
Tue, 02/20/2024 - 13:29
Permalink
LoRa commands
I don't have any experience with LoRa modules, but you will need to get the passed messages into Python instead of just being printed to the terminal before you can use them to control the board.
This module may be what you need: https://pypi.org/project/pyLoRa/
I would recommend trying to get their
rx_cont.py
example to work and see what it is printing for the payload (inon_rx_done
), it probably won't include the diagnostic output you are currently seeing.