Using the Wacc expansion header for a UART device

Hello!

We are planning to swap our the Stretch gripper for a prosthetic hand that communicates using UART. For our initial testing, we have been using a UART to USB adapter that connects to the hand with TX, RX, GND. After going through the hardware guide again, it seems we could configure the expansion header for Serial UART and do without the adapter. I have checked out the wrist extension header tutorials but am still a bit lost on where to start for a UART sensor.

Any advice pointing me in the right direction would be a big help.

Thanks!
Lionel

At a high level the process would be:

  1. Establish serial comms between the Arduino UART and your gripper
  2. Plumb the new UART device into the Wacc firmware / communication layer
  3. Extend Stretch Body to include the gripper so it can be accessed via Python

Numbers 2 & 3 are fairly straightforward pattern matching from the I2C/SPI tutorials.

Number 1 (establishing serial comms) can be tricky depending on your device and its communication/bandwidth requirements.

To get started on that, it might be easiest for us to just create a UART tutorial comparable to the SPI/I2C one. I’d guess we could have something to you in about 1-2 weeks. Would that work for you?

1 Like

Thanks for your reply, Aaron. We are not in a rush to get this working so that would be perfect.

Thanks,
Lionel

Great, we’ll report back here when the tutorial is ready.

1 Like

Hello Lionel. We’ve posted a tutorial on how to integrate a serial device onto the wrist expansion header.

Good luck, let us know how it goes!

Awesome, thank you so much, Aaron!

Hi Aaron,

The serial sensor tutorial was very helpful! I’m currently still testing with an Arduino emulating the wrist board until I finish the firmware changes.

One small thing, it seems the wacc_calc.py file is missing {self.valid_firmware_protocol = ‘pMyCalc’} in the init method for it to work out of the box. Everything else went very smoothly.

Thanks,
Lionel

Great, glad to hear it. Good catch on the protocol version bug. I’ve updated the documentation and code to now use ‘p99’.

For background, we are developing an automatic firmware updating tool that reads the protocol version. It now expects a number (eg 99) rather than a string. So to future proof the tutorial, we use ‘p99’. For your own custom protocols it really only matters that the protocol ID of the Arduino struct definition, and the protocol ID of the Python class, match.

1 Like