This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm whether you accept or reject these cookies being set.

A cookie will be stored in your browser regardless of choice to prevent you being asked this question again. You will be able to change your cookie settings at any time using the link in the footer.

  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Mating Arduino Uno WiFi to a motor controller
#1
Hello World,
For a number of reasons, I'm interested in controlling my wheel running pypilot on openplotter from the pilot's desk with a wifi link. To that end I picked up an Arduino Uno Wifi (first developers' edition). I'm seasoned in building and operating linux/unix systems, with good networking and server skills, but I have no experience with these arduino controllers, and scant exposure to coding.

I understand that I need this controller to exchange duplex serial data with pypilot on the openplotter box as either signalk or nmea0183 sentences.( I know this would be trivial if I was hardwiring it with 3 conductors + shield/ground, but on our Tartan, the cockpit is exposed, and the installation will need to be tucked tightly into the lazarette ).

The Uno Wifi has native support for MQTT messages. I've been able to configure it to connect with the MQTT node on openplotter; that is, the Arduino webpage confirms a connection to the Pi ip on port 1883,  but that is the extent of my progress.  I haven't gotten to where I've actually made a sketch that exchanges messages. Clearly, I've got much yet to learn.

So, here's what I'm asking, if anyone can help:

1. Am I spinning my wheels with this? Is MQTT a protocol suited to controlling the arduino from pypilot? Can the motorcontroller's messages be passed back to pypilot via MQTT? If so, how to begin? Can MQTT messages be passed into the signalk bus?
2. Am I overlooking something much simpler? Is there a way to configure this Uno WiFi to directly establish a serial connection via its wifi device?  Has someone modified Sean's motor.ino to try this already?
3. Oh, and one last question: In Pypilot on OpenPlotter, the field in which the controller device or port is configured doesn't accept entries. I can put a cursor in there, but typing in the field only produces a <bonk!> with every keystroke? Is my build of pypilot broken? It is fully updated.

Thanks in advance for whatever you can share. Pointers, code samples, warnings, sympathy et al are appreciated.
Elliott
  Reply
#2
i don't see the need for wireless.
1. probably

2. there has to be power for the autopilot motor all that is needed is to wire in the controller somewhere between the battery and the motor.then you can control it in opencpn with the plugin or a browser on any device.
the controller can be close to the pi "openplotter/pypilot arduino/motor ctrl" and run the power from the battery to the controller and back to the ap motor.
you dont need the arduino & motor controller next to the motor..it sounds like that's what your thinking of doing with wireless.

3. does the arduino have the motor ino installed and connected to the pi usb or serial and configured in op's serial tab.?
once installed in op serial tab those entries will be there by default.
mare liberum
  Reply
#3
Try searching for "replace serial link with esp8266"
This is one:
https://github.com/jeelabs/esp-linkf

or "replace serial link with radio link"
commercial products

Clarification and thoughts:
Are you just wishing to replace just the serial cable between the motor control and the RPI openplotter?
Maybe consider installing the tinypilot RPI zero w next to the controller an give the openplotter the IP address of the zero W.
They need to be connected to the same network of course.
--
Larry - s/v Katie Lee Passport 45 Ketch (For Sale) - somewhere in Taiwan
  Reply
#4
(06-30-2019, 07:05 PM)svkatielee Wrote: Try searching for "replace serial link with esp8266"
This is one:
https://github.com/jeelabs/esp-linkf

or "replace serial link with radio link"
commercial products

Clarification and thoughts:
Are you just wishing to replace just the serial cable between the motor control and the RPI openplotter?
Maybe consider installing the tinypilot RPI zero w next to the controller an give the openplotter the IP address of the zero W.
They need to be connected to the same network of course.
My fall back plan is to get a pi-zero-w, and just go with tiny pilot. Still, I would like to try this other first. Thank you for the link and search string. ESP-link is an especially good tip, as it appears to be a native Uno WiFi library.
Elliott
  Reply
#5
MQTT is a great idea, but I haven't gotten around to supporting it. It is certainly possible to control pypilot from a wifi link. So far, all 4 of the control interfaces can be run on remote hosts, even the lcd and keypad script could run on a different pi zero w. The webapp needs a browser, the python scripts need python (so far only known to work on linux) and the python scripts, and pypilot plugin works on supported opencpn platforms.

What kind of control interface do you have in mind? I can suggest which of the existing interfaces is closest to modify if you are doing something new.
  Reply
#6
(07-02-2019, 07:38 PM)seandepagnier Wrote: MQTT is a great idea, but I haven't gotten around to supporting it.   It is certainly possible to control pypilot from a wifi link.  So far, all 4 of the control interfaces can be run on remote hosts, even the lcd and keypad script could run on a different pi zero w.   The webapp needs a browser, the python scripts need python (so far only known to work on linux) and the python scripts, and pypilot plugin works on supported opencpn platforms.

What kind of control interface do you have in mind?  I can suggest which of the existing interfaces is closest to modify if you are doing something new.
The only two control interfaces I've tried are the opencpn pypilot plugin and the web interface. I've bread-boarded the 'pi3B+daisyhat+sensors' box via usb to the arduino uno wifi, and that's breadboarded over to the mcu, which is driving an Autohelm 3000 motor. The web app hasn't been working well: It's not responsive enough. The pypilot plugin is responsive, but not quite right. (It's v 0.5.0, I think). No luck yet building 0.9.0.

I'd like to add some kind of remote handheld (preferably not IR/optical; maybe bluetooth?), but that's way down the list for now. As I think about it, an IR tv remote to a sensor mounted under the doger somewhere isn't a bad idea. Simple, and low cost...

So, next to do:
  I need help configuring a wifi link to serial connect the pi3B+daisy box to the arduino uno wifi, and I just don't know enough about arduino yet to do it.  As I'd mentioned, one native path with the uno wifi is MQTT, but the coding is beyond my skill. If there's a simpler way to establish a serial wifi link between them, I haven't found a how-to yet.

Here's a link to a video of what's working so far:

RPi3B+dAISy hat+Pypilot set up

Thanks for all your hard work on this project! And to the other developers and users who've volunteered their experience.
Elliott
  Reply
#7
(07-03-2019, 09:38 PM)skyeyedoc Wrote:
(07-02-2019, 07:38 PM)seandepagnier Wrote: MQTT is a great idea, but I haven't gotten around to supporting it.   It is certainly possible to control pypilot from a wifi link.  So far, all 4 of the control interfaces can be run on remote hosts, even the lcd and keypad script could run on a different pi zero w.   The webapp needs a browser, the python scripts need python (so far only known to work on linux) and the python scripts, and pypilot plugin works on supported opencpn platforms.

What kind of control interface do you have in mind?  I can suggest which of the existing interfaces is closest to modify if you are doing something new.
The only two control interfaces I've tried are the opencpn pypilot plugin and the web interface. I've bread-boarded the 'pi3B+daisyhat+sensors' box via usb to the arduino uno wifi, and that's breadboarded over to the mcu, which is driving an Autohelm 3000 motor. The web app hasn't been working well: It's not responsive enough. The pypilot plugin is responsive, but not quite right. (It's v 0.5.0, I think). No luck yet building 0.9.0.

I'd like to add some kind of remote handheld (preferably not IR/optical; maybe bluetooth?), but that's way down the list for now. As I think about it, an IR tv remote to a sensor mounted under the doger somewhere isn't a bad idea. Simple, and low cost...

So, next to do:
  I need help configuring a wifi link to serial connect the pi3B+daisy box to the arduino uno wifi, and I just don't know enough about arduino yet to do it.  As I'd mentioned, one native path with the uno wifi is MQTT, but the coding is beyond my skill. If there's a simpler way to establish a serial wifi link between them, I haven't found a how-to yet.

Here's a link to a video of what's working so far:

RPi3B+dAISy hat+Pypilot set up

The video says "Not available".

to compile the plugin on openplotter 1.2.0 you need to add some development libraries first:

Code:
sudo apt install libwxbase3.0-dev libbz2-dev wx-common libwxgtk3.0-dev
--
Larry - s/v Katie Lee Passport 45 Ketch (For Sale) - somewhere in Taiwan
  Reply
#8
(07-03-2019, 09:46 PM)svkatielee Wrote: The video says "Not available".

to compile the plugin on openplotter 1.2.0 you need to add some development libraries first:

Code:
sudo apt install libwxbase3.0-dev libbz2-dev wx-common libwxgtk3.0-dev

The youtube video was probably still rendering when you tried last night. It's working this morning. I'll install those libraries and try again. Thanks!
  Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)