# RS 232 Hat Expansion

**URL:** <https://forums.balena.io/t/rs-232-hat-expansion/175791>\
**Category:** balenaFin\
**Created:** [August 20, 2020, 9:15am UTC](https://forums.balena.io/t/rs-232-hat-expansion/175791 "2020-08-20T09:15:37Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![chriswoj](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/chriswoj/32/4329_2.png) [@chriswoj](https://forums.balena.io/u/chriswoj)\
**Post date:** [August 20, 2020, 9:15am UTC](https://forums.balena.io/t/rs-232-hat-expansion/175791/1 "2020-08-20T09:15:37Z")

</div>

Hi there,

I’m currently working on a project to exend the Balenafin with RS 232 connections to external hardware. Unfortunately I can’t get it running. Hopefully you can help!

What I have and what I did so far:

- Installed the balena customized raspbian Image
- I have this Hat [https://www.waveshare.com/2-ch-rs232-hat.htm](https://www.waveshare.com/2-ch-rs232-hat.htm) and attached it.
- Followed the instructions for the setup here: [https://www.waveshare.com/wiki/2-CH\_RS232\_HAT](https://www.waveshare.com/wiki/2-CH_RS232_HAT)
- I removed every customization I made to the boot/config.txt file and added the appropriate overlay as stated in the setup.
- Activated the SPI communication in the /boot/config.txt file.
- I got the hardware interfaces in the /dev folder
- Connected the custom Hardware and send via RS232, the light on the Hat flashed as it’s recieving data, but I can’t recieve data while listening to the ports with “cat /dev/…”

Before I connected the RS232 via the GPIO Ports and everything worked - what am I missing? Any ideas? Any help would be highly appreciated as I’m stuck with no ideas left.

best chris

---

<div class="post-metadata">

**Author:** ![mbalamat](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/mbalamat/32/1245_2.png) [@mbalamat](https://forums.balena.io/u/mbalamat)\
**Post date:** [August 20, 2020, 11:06am UTC](https://forums.balena.io/t/rs-232-hat-expansion/175791/7 "2020-08-20T11:06:51Z")

</div>

Hello @chriswoj and welcome to our forums!  
I guess when you say `balena customized raspbian Image` you mean balenaOS. If so which version? Also which version of the Fin do you have? 1.0 or 1.1 ?

---

<div class="post-metadata">

**Author:** ![mbalamat](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/mbalamat/32/1245_2.png) [@mbalamat](https://forums.balena.io/u/mbalamat)\
**Post date:** [August 20, 2020, 11:19am UTC](https://forums.balena.io/t/rs-232-hat-expansion/175791/8 "2020-08-20T11:19:46Z")

</div>

Assuming that you are on balenaOS, you might want to check out the docs about configuring the SPI I2C etc [https://www.balena.io/docs/learn/develop/hardware/i2c-and-spi/#spi](https://www.balena.io/docs/learn/develop/hardware/i2c-and-spi/#spi) .

---

<div class="post-metadata">

**Author:** ![chriswoj](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/chriswoj/32/4329_2.png) [@chriswoj](https://forums.balena.io/u/chriswoj)\
**Post date:** [August 20, 2020, 11:43am UTC](https://forums.balena.io/t/rs-232-hat-expansion/175791/10 "2020-08-20T11:43:04Z")

</div>

Thank you both for your answers. I used this image: [https://github.com/balena-os/pi-gen/releases](https://github.com/balena-os/pi-gen/releases) as I did not want to introduce so much changes in the first shot.

I also added / uncommented the “dtparam=spi=on” to the boot/config.txt file.

best chris

---

<div class="post-metadata">

**Author:** ![mbalamat](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/mbalamat/32/1245_2.png) [@mbalamat](https://forums.balena.io/u/mbalamat)\
**Post date:** [August 20, 2020, 12:08pm UTC](https://forums.balena.io/t/rs-232-hat-expansion/175791/11 "2020-08-20T12:08:23Z")

</div>

Ohh ok, then since you are not on balenaOS and you are on raspbian I would expect the instructions to work as if you had a Pi. Also which raspbian release did you use full, lite? Also which version of the fin did you use 1.0 or 1.1?

---

<div class="post-metadata">

**Author:** ![chriswoj](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/chriswoj/32/4329_2.png) [@chriswoj](https://forums.balena.io/u/chriswoj)\
**Post date:** [August 20, 2020, 5:16pm UTC](https://forums.balena.io/t/rs-232-hat-expansion/175791/13 "2020-08-20T17:16:14Z")

</div>

Thought that too! Hoped that somebody of you already got this working and/or have more exerpience with the Hat.

I used the full version and have the balena 1.1

---

<div class="post-metadata">

**Author:** ![phil-d-wilson](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/phil-d-wilson/32/3730_2.png) [@phil-d-wilson](https://forums.balena.io/u/phil-d-wilson)\
**Post date:** [August 21, 2020, 8:20am UTC](https://forums.balena.io/t/rs-232-hat-expansion/175791/15 "2020-08-21T08:20:16Z")

</div>

Hi Chris,

This seems quite a specialised HAT, so I’m not sure if we’ll have someone who has tried it, especially on the Fin. But I’ll reach out to some of our engineers and see if they have any more suggestions of things to try.

By the way: was there a specific reason for using the Raspbian image over balenaOS? If not, it might be worth us investigating moving over, since balenaOS is updated more frequently.

Phil

---

<div class="post-metadata">

**Author:** ![chriswoj](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/chriswoj/32/4329_2.png) [@chriswoj](https://forums.balena.io/u/chriswoj)\
**Post date:** [August 25, 2020, 11:54am UTC](https://forums.balena.io/t/rs-232-hat-expansion/175791/18 "2020-08-25T11:54:56Z")

</div>

Hi Phil,

I flashed the balenaOS to the fin, in order to give it a try, but how do I add the overlay? In the raspberry I modified the /boot/config.txt and added:

---

<div class="post-metadata">

**Author:** ![zvin](https://avatars.discourse-cdn.com/v4/letter/z/a5b964/32.png) [@zvin](https://forums.balena.io/u/zvin)\
**Post date:** [August 25, 2020, 12:07pm UTC](https://forums.balena.io/t/rs-232-hat-expansion/175791/19 "2020-08-25T12:07:49Z")

</div>

Hello,  
I think a part of your message is missing.  
Please check [https://www.balena.io/docs/reference/OS/advanced/#setting-device-tree-overlays-dtoverlay-and-parameters-dtparam](https://www.balena.io/docs/reference/OS/advanced/#setting-device-tree-overlays-dtoverlay-and-parameters-dtparam)  
You can edit `dtoverlay` by setting `BALENA_HOST_CONFIG_dtoverlay` application or device env var from the dashboard.

---

<div class="post-metadata">

**Author:** ![chriswoj](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/chriswoj/32/4329_2.png) [@chriswoj](https://forums.balena.io/u/chriswoj)\
**Post date:** [August 25, 2020, 12:23pm UTC](https://forums.balena.io/t/rs-232-hat-expansion/175791/21 "2020-08-25T12:23:59Z")

</div>

Hi there,

oh sorry. Ok got it, tried it without any balena cloud app. Now I got it working with the balenaOS and the Cloud registration. (FYI)

I will have to check with my customer if re-writing it to a docker container will work for him.

Thanks

best chris
