# CM3 & CM3+ with node red gpio

**URL:** <https://discourse.nodered.org/t/cm3-cm3-with-node-red-gpio/20407>\
**Category:** General\
**Created:** [15 January 2020 21:00 UTC](https://discourse.nodered.org/t/cm3-cm3-with-node-red-gpio/20407 "2020-01-15T21:00:27Z")\
**Posts on this page:** 16\
**Page:** 1

<div class="post-metadata">

**Author:** ![SCSJA](https://avatars.discourse-cdn.com/v4/letter/s/bbe5ce/32.png) [@SCSJA](https://discourse.nodered.org/u/SCSJA)\
**Post date:** [15 January 2020 21:00 UTC](https://discourse.nodered.org/t/cm3-cm3-with-node-red-gpio/20407/1 "2020-01-15T21:00:27Z")

</div>

I have a project that is utilizing a carrier board (balenaFin) and a Raspberry Pi Compute Module 3. The node red utilized some of the pins as digital inputs and outputs. It was up and working fine, then we were sent the CM3+ to put on the carrier board. I am using balena cloud and my dockerfile has everything versioned to my original project, however, with the new CM3+ some of the pins are not working with the node red (as shown in the pictures). Has anyone run into this with the CM3+? I can swap out the CM3 and CM3 + and the pins work fine, which is what i did to produce these photos.

 ![not working](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/c/6/c6d006ff870034d6c05e70e45ab9d6eb20d17ad7.jpeg) ![working](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/d/0/d045f9c8291aae12605ec885b222bc4b2c77e77b.jpeg)

---

<div class="post-metadata">

**Author:** ![SCSJA](https://avatars.discourse-cdn.com/v4/letter/s/bbe5ce/32.png) [@SCSJA](https://discourse.nodered.org/u/SCSJA)\
**Post date:** [15 January 2020 21:10 UTC](https://discourse.nodered.org/t/cm3-cm3-with-node-red-gpio/20407/2 "2020-01-15T21:10:09Z")

</div>

And I also swap the carrier out with another CM3+ just to make sure it wasn't the that the RPi CM3+ was bad. Same results

---

<div class="post-metadata">

**Author:** ![dceejay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dceejay/32/38_2.png) [@dceejay](https://discourse.nodered.org/u/dceejay)\
**Post date:** [15 January 2020 21:19 UTC](https://discourse.nodered.org/t/cm3-cm3-with-node-red-gpio/20407/3 "2020-01-15T21:19:30Z")

</div>

I've not looked or ever played with a CM3 - but I would look to see if the BCM pin numbers are mapped differently to physical pin numbers and GPIO numbering.

---

<div class="post-metadata">

**Author:** ![SCSJA](https://avatars.discourse-cdn.com/v4/letter/s/bbe5ce/32.png) [@SCSJA](https://discourse.nodered.org/u/SCSJA)\
**Post date:** [15 January 2020 21:22 UTC](https://discourse.nodered.org/t/cm3-cm3-with-node-red-gpio/20407/4 "2020-01-15T21:22:54Z")

</div>

Thanks, according to the documentation from Raspberry Pi both the CM3 and CM3+ blade pins are the same as I checked that as well, so it should be a drop in replacement as far as I can tell. Of course the table is quite big so I could be wrong but it appears identical

---

<div class="post-metadata">

**Author:** ![SCSJA](https://avatars.discourse-cdn.com/v4/letter/s/bbe5ce/32.png) [@SCSJA](https://discourse.nodered.org/u/SCSJA)\
**Post date:** [20 January 2020 16:10 UTC](https://discourse.nodered.org/t/cm3-cm3-with-node-red-gpio/20407/5 "2020-01-20T16:10:27Z")

</div>

@dceejay @knolleary I've seen you two on a majority of the forums I read to help solve my issues so I figured you two were the best to contact and point me in the right direction. Someone at the carrier board manufacturer was able to solve the issue. They said "it turns out one of the dependencies used by node-red (raspberry-gpio-python) will fail to correctly identify the CM3+, instead it will see the board as a Pi 1 (which only has a 26 pin GPIO header), therefore any request to use a pin higher than that will be interpreted as invalid". I see with the new version of node-red, it removes any of the gpio modules that used to be included in the Node-red base package. I have mine set at 0.20.7, which module should I raise an issue with? Would it be Node-Red or the programmer of raspberry-gpio-python, or with Raspberry foundation directly? Or if you know a work around to it, like a python script that I could run from Node-red that would be helpful. I would say I'm beginner, but I can learn what i need to pretty fast, just lost a little in what direction to take

---

<div class="post-metadata">

**Author:** ![dceejay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dceejay/32/38_2.png) [@dceejay](https://discourse.nodered.org/u/dceejay)\
**Post date:** [20 January 2020 16:45 UTC](https://discourse.nodered.org/t/cm3-cm3-with-node-red-gpio/20407/6 "2020-01-20T16:45:13Z")

</div>

So just to check... the Node-RED node lets you select the pins you do want to use?  
I don't think we remove any modules ? the latest gpio package is not part of the core but is still available here - [https://www.npmjs.com/package/node-red-node-pi-gpio](https://www.npmjs.com/package/node-red-node-pi-gpio) - and does indeed rely on the RPi.GPIO package from raspbian - ` sudo apt install python-rpi.gpio` should get the latest. If that is indeed failing then yes they need to fix it. If you can confirm we can try and prod them from this end.

---

<div class="post-metadata">

**Author:** ![SCSJA](https://avatars.discourse-cdn.com/v4/letter/s/bbe5ce/32.png) [@SCSJA](https://discourse.nodered.org/u/SCSJA)\
**Post date:** [20 January 2020 17:22 UTC](https://discourse.nodered.org/t/cm3-cm3-with-node-red-gpio/20407/7 "2020-01-20T17:22:03Z")

</div>

Yes that is correct. Node red allows the selection, however once its selected it shows a little red box with "Stopped" next to it. I also noticed in the RPi.GPIO ([https://pypi.org/project/RPi.GPIO/](https://pypi.org/project/RPi.GPIO/)) version 0.5.11 it mentions a fix for pins \>26

---

<div class="post-metadata">

**Author:** ![dceejay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dceejay/32/38_2.png) [@dceejay](https://discourse.nodered.org/u/dceejay)\
**Post date:** [20 January 2020 18:17 UTC](https://discourse.nodered.org/t/cm3-cm3-with-node-red-gpio/20407/8 "2020-01-20T18:17:03Z")

</div>

So which version of RPi.GPIO are you running ?

---

<div class="post-metadata">

**Author:** ![SCSJA](https://avatars.discourse-cdn.com/v4/letter/s/bbe5ce/32.png) [@SCSJA](https://discourse.nodered.org/u/SCSJA)\
**Post date:** [20 January 2020 19:06 UTC](https://discourse.nodered.org/t/cm3-cm3-with-node-red-gpio/20407/9 "2020-01-20T19:06:17Z")

</div>

I show that I have version 0.6.5 installed. I just thought It might help for troubleshooting

---

<div class="post-metadata">

**Author:** ![dceejay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dceejay/32/38_2.png) [@dceejay](https://discourse.nodered.org/u/dceejay)\
**Post date:** [20 January 2020 19:25 UTC](https://discourse.nodered.org/t/cm3-cm3-with-node-red-gpio/20407/10 "2020-01-20T19:25:17Z")

</div>

Can you try some pure python to test the library against the CM modules ?  
eg like [https://raspi.tv/2013/rpi-gpio-basics-2-how-to-check-what-pi-board-revision-you-have](https://raspi.tv/2013/rpi-gpio-basics-2-how-to-check-what-pi-board-revision-you-have)  
see if they do indeed report differently so we can report it.

---

<div class="post-metadata">

**Author:** ![SCSJA](https://avatars.discourse-cdn.com/v4/letter/s/bbe5ce/32.png) [@SCSJA](https://discourse.nodered.org/u/SCSJA)\
**Post date:** [20 January 2020 19:34 UTC](https://discourse.nodered.org/t/cm3-cm3-with-node-red-gpio/20407/11 "2020-01-20T19:34:33Z")

</div>

Here is what appeared when following the instructions you gave on the link

 ![REVISION](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/7/6/76e33676085d9a007a191117d4039f0cce9f716b.jpeg) ![version](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/2/2/2273d85f3a41d742bdad17b4efc54cde505aa0e3.jpeg)

---

<div class="post-metadata">

**Author:** ![Ivan](https://avatars.discourse-cdn.com/v4/letter/i/df788c/32.png) [@Ivan](https://discourse.nodered.org/u/Ivan)\
**Post date:** [10 December 2020 07:15 UTC](https://discourse.nodered.org/t/cm3-cm3-with-node-red-gpio/20407/12 "2020-12-10T07:15:11Z")

</div>

HI.

> [@Using a raspberry compute module with Node-red](https://discourse.nodered.org/t/using-a-raspberry-compute-module-with-node-red/3607):
>
> Does anybody know if the rpi-gpio node can be used with a compute module (cm3) ? The pin out is different and the rpi-gpio node does not detect the board type. Thank

---

<div class="post-metadata">

**Author:** ![gonzalito](https://avatars.discourse-cdn.com/v4/letter/g/ecccb3/32.png) [@gonzalito](https://discourse.nodered.org/u/gonzalito)\
**Post date:** [7 January 2021 17:02 UTC](https://discourse.nodered.org/t/cm3-cm3-with-node-red-gpio/20407/13 "2021-01-07T17:02:56Z")

</div>

Hello, I have exactly the same problem: The GPIOs work perfectly with CM3 but I have problems with CM3 +, the digital input nodes are in "Stopped" state. Could you solve it?

---

<div class="post-metadata">

**Author:** ![SCSJA](https://avatars.discourse-cdn.com/v4/letter/s/bbe5ce/32.png) [@SCSJA](https://discourse.nodered.org/u/SCSJA)\
**Post date:** [7 January 2021 17:54 UTC](https://discourse.nodered.org/t/cm3-cm3-with-node-red-gpio/20407/14 "2021-01-07T17:54:00Z")

</div>

Did you try following the link above and follow those steps posted by Ivan? I have not tried it, as this was so long ago. But I solved it by utilizing python scripts in Execute and Daemon nodes as well as the RPi.GPIO library for python. It's a little more cumbersome than using node-red directly, but it worked.

---

<div class="post-metadata">

**Author:** ![alexsp](https://avatars.discourse-cdn.com/v4/letter/a/46a35a/32.png) [@alexsp](https://discourse.nodered.org/u/alexsp)\
**Post date:** [7 February 2021 10:45 UTC](https://discourse.nodered.org/t/cm3-cm3-with-node-red-gpio/20407/15 "2021-02-07T10:45:51Z")

</div>

The following works for me in CM3+ module (actually this is the device [Panel PC - 7" Raspberry Pi Water-Resistant Industrial Panel PC (CPi-A070WR)](http://comfiletech.com/new-products/cpi-a070wr-7-industrial-raspberry-pi-touch-panel-pc/))

- Open `/home/pi/.node-red/node_modules/node-red-node-pi-gpio/nrgpio.py`
- Change line 34 to `GPIO.setmode(GPIO.BCM)`  
You will get some validation errors to the node as it identifies the pin numbers as not valid but other than that it works

---

<div class="post-metadata">

**Author:** ![dceejay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dceejay/32/38_2.png) [@dceejay](https://discourse.nodered.org/u/dceejay)\
**Post date:** [9 February 2021 11:57 UTC](https://discourse.nodered.org/t/cm3-cm3-with-node-red-gpio/20407/16 "2021-02-09T11:57:03Z")

</div>

Hi All - I have changed the basic GPIO nodes t now use BCM rather than Pins - I haven't yet pushed it to the library as I think it needs testing first... you can install in manually by changing to your user directory eg

```auto
cd ~/.node-red
npm i node-red-node-pi-gpio@beta

```

You can now either use the usual pin selector picture - but the pin field beneath is now the BCM GPIO number - and you can enter than manually if desired and it should now work ok with cm3 modules etc...

But as I said - I don't have one to test so please try it and give me feedback...

Many thanks
