Members | Sign In
Legacy MOVI User Community Forum (readonly) > Non-Arduino MOVI
avatar

Connecting MOVI to a Raspberry PI

posted Jan 03, 2016 16:40:42 by IngoSigmund
Hi all,
I am planning to connect the MOVI (once I get it :-) ) to a Raspberry PI. As I understand the documentation I would only need to connect GND, RX and TX in order to be able to communicate from the RPI to MOVI. Additionally I would need a separate Power Supply on pin Vin (I am planning for 12V). Since the RPI is a 3.3V device JP1 should stay open.
Can you confirm that, or am I missing something ?

Take care
Ingo
page   1
10 replies
avatar
GeraldFriedland said Jan 05, 2016 04:13:35
I am not very familiar with the Rasberry PI yet but speaking for MOVI you are correct: You need to find an UART on the Rasberry PI and connect it to MOVI's RX and TX. The power supply to MOVI's Vin should provide 6V-16V. Do not set the J1. In addition, however, you need to provide 3.3V to MOVI's IOREF. Software-wise set the bitrate of Rasberry PI's UART to 9600bps.

For an easy connection test send a "PING" over Rasberry PI's UART (which should result in a reply from MOVI on the serial port) or a "SAY Hello" (which should result in the word uttered through a speaker connected to MOVI).

Once you get this going, you can start taking a look at MOVI's Arduino library (on Github) and see which parts you want to port over to the PI for more convenient programming. Alternatively, the low level interface provides everything you need but it's not as straightforward to use.

Have fun and keep us posted!
avatar
Pilif said Jan 05, 2016 12:13:22
Hello,
Thank you for this board :)

I also plan to use RPI or some of the other platform boards. I plan to transfer part/all of the API to Python (I wont need all of it at first). Since I will do that in my free time it will take a while :) but then I will post it here .
pins to use:
● VIN and GND — to draw power
● D10 and D11 — for serial communication
● IOREF — to determine the voltage for serial communication

Filip
avatar
PeterLum said Feb 06, 2016 02:39:30
Some questions:

1. MOVI needs a separate power supply for its own? 6-16V? true?
2. RX and TX levels are for 5V or 3.3V?
3. When connecting RX/TX to Arduino Nano digital pins, what should be JP1 setting?

Thanks and hope to get some answers soon.

Many thanks!
avatar
fractor@audeme.com said Feb 09, 2016 22:10:52
1) Yes. 6-16V, 500mA (even though we really recommends 9V or 12V). See also FAQ.
2) RX and TX levels are for 5V or 3.3V depending on the voltage you supply on IOREF. So if you supply 3.3V on IOREF, RX and TX take 3.3V, if you supply 5V, they take 5V.
3) Setting JP1 short circuits IOREF to 5V. This is only useful for older Arduino Uno-compatible boards that didn't have IOREF yet. The Nano is 5V but doesn't have Arduino-compatible headers. So I would just connect a 5V source (e.g. Nano pin 27) to MOVIs IOREF pin and you are set.

In summary:
- Connect Nano pin 27 (+5V) to MOVI's IOREF
- Connect MOVI's TX and RX to Nano pin 13 and 14 (D10, D11), respectively
- Connect speakers to MOVI
- Leave JP1 open
- Connect an external power supply
- Report back if it worked ;-)
avatar
Ingo Sigmund said Mar 23, 2016 20:55:10
Hello
has anyone of you succeeded to talk to the MOVI via a serial connection from a Raspberry PI? I tried today (with all HW connections mentioned above - see below for the exact connections I used) and fired up a minicom on the PI (sudo minicom -b 9600 -o -D /dev/ttyAMA0).
I was expecting that when I enter some of the low-level commands (e.g. HELP) I get some answer back from the MOVI but unfortunately nothin happens.
The serial connection on the GPIO ports of the PI does work (I tried to connect to a second PI and was able to communicate via minicom)
Does anyone have an idea for this ?

Take care
Ingo

Pi pin----Signal------Movi Pin
6 ----------GND------- GND
8 TX ----------------- D10 (RX)
9 RX ----------------- D11 (TX)
1 ---------3.3V------- IOREF
xxxxxxxx12V ------- Vin (from separate Power Supply)
[Last edited Mar 23, 2016 21:24:37]
avatar
GeraldFriedland said Mar 23, 2016 22:28:48
Ingo,

Your connection looks good. One thing that might help is that I would execute the following command on the PI:
stty -echo -F /dev/ttyXXX 9600

with XXX being your serial port (AMA1?). This sets the right parameters for the serial connection.

In a first attempt, I would _not_ use minicom as it does a bunch of other stuff on the serial connection (like hardware flow control).

Try executing the following bash script to communicate with MOVI (e.g. by running it and typing "HELP" <enter>).

#!/bin/sh
# connectmovi.sh
# Usage:
# $ connectmovi.sh <device> <port speed>
# Example: connect.sh /dev/ttyAMA1

# Set up device
stty -echo -F $1 9600

# Let cat read the device $1 in the background
cat $1 &

# Capture PID of background process so it is possible to terminate it when done
bgPid=$?

# Read commands from user, send them to device $1
while read cmd
do
   echo "$cmd" 
done > $1

# Terminate background read process (eg. on CTRL+C)
kill $bgPid



Let us know if that helped.
[Last edited Mar 23, 2016 22:29:30]
avatar
Ingo Sigmund said Mar 24, 2016 18:58:15
Hi Gerald,
actually I had the wrong wiring.
apparently D10 is TX and D11 is RX. I think it really depends on how you look at it - from the Arduino point of view or from the Movi point of view. Anyway it works now with minicom and your script as well. Thanks for your quick help.

Take care
Ingo


So the correct wiring is :

Pi pin----Signal------Movi Pin
6 ----------GND------- GND
8 TX ----------------- D11 (RX)
9 RX ----------------- D10 (TX)
1 ---------3.3V------- IOREF
xxxxxxxx12V ------- Vin (from separate Power Supply)
[Last edited Mar 24, 2016 19:10:37]
avatar
GeraldFriedland said Mar 25, 2016 04:19:03
Thanks for your feedback!

RX and TX are just too easy to confuse...
avatar
Christopher Coté said Apr 26, 2016 17:33:36
Hey guys, got this running, but was seeing some randomness in the serial responses, missing text, odd line breaks. I've got it running very smoothly now, but you have to disable linux from using ttyAMA0 for getty and kernel messages.

You'll want to run

sudo systemctl disable serial-getty@ttyAMA0.service


to disable getty on startup

and edit /boot/cmdline.txt and remove any references to ttyAMA0 or serial0

there's also this script, https://github.com/lurch/rpi-serial-console which I have not tested.
avatar
GeraldFriedland said May 20, 2016 03:44:31
Thanks everybody. I wrote it all together into an Instructable. Check it out here:
http://www.instructables.com/id/Untethered-Speech-Dialog-Using-MOVI-With-the-Rasbe/
Login below to reply: