# Nr2pico u2if - Python to JS - help WANTED

**URL:** <https://discourse.nodered.org/t/nr2pico-u2if-python-to-js-help-wanted/87706>\
**Category:** General\
**Created:** [4 May 2024 19:58 UTC](https://discourse.nodered.org/t/nr2pico-u2if-python-to-js-help-wanted/87706 "2024-05-04T19:58:30Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![PizzaProgram](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/pizzaprogram/32/19431_2.png) [@PizzaProgram](https://discourse.nodered.org/u/PizzaProgram)\
**Post date:** [4 May 2024 19:58 UTC](https://discourse.nodered.org/t/nr2pico-u2if-python-to-js-help-wanted/87706/1 "2024-05-04T19:58:30Z")

</div>

I believe there would be a need for a direct Raspberry Pi Pico USB \<-\> NoreRed interface:

_Poll ([view on site](https://discourse.nodered.org/t/nr2pico-u2if-python-to-js-help-wanted/87706/1))_

Previously I've [listed the possibilities here ...](https://discourse.nodered.org/t/communicating-between-rpi-pico-via-usb/85294/9) and I think the best approach would be: **u2if** firmware working together directly with NoreRed.

## But I need help to translate this python code to JavaScript (Nore-Red):

> **[u2if/source/machine at main · execuc/u2if](https://github.com/execuc/u2if/tree/main/source/machine)**
>
> USB to interfaces implementing MicroPython "machine" module functionalities on a computer. - execuc/u2if

_(I know there is pythonshell available, but that would not be the same fast and would complicate install for end-users.)_

### Benefits (over NR-Arduino Firmata node):

- More stable C++ firmware based on official pico-sdk, handling reconnect
- Much higher transfer rate (min. 1Mbit)
- only necessary transfers = less CPU usage _(not continuous 57K)_
- Not just `PWM + Digital-IO`, but other functions would work too:  
(`ADC, Temperature, I2S, SPI, HUB75`, ...)

### Also other, compatible RP2040 based boards would work too:

- PICO
- FEATHER
- ITSYBITSY
- QTPY
- QT2040\_TRINKEY

## Why USB?

- Can be directly plugged in, no need to pre-configure SSID etc.
- The board is cheaper without Wifi / BT
- Connection is more stable than wireless
- USB cables are shielded by default, and can reach 4.5m (+ more with extenders),  
so industrial applications are possible too!
- can multiply ports with cheap USB hubs.

_(Tried to do it myself using ChatGPT, without success.)_

---

<div class="post-metadata">

**Author:** ![ralphwetzel](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/ralphwetzel/32/53713_2.png) [@ralphwetzel](https://discourse.nodered.org/u/ralphwetzel)\
**Post date:** [4 May 2024 20:28 UTC](https://discourse.nodered.org/t/nr2pico-u2if-python-to-js-help-wanted/87706/2 "2024-05-04T20:28:50Z")

</div>

There's no need for an "interface".  
You may execute Node-RED flows on a Pico with [`node-red-mcu`](https://github.com/phoddie/node-red-mcu) & the [`node-red-mcu-plugin`](https://flows.nodered.org/node/@ralphwetzel/node-red-mcu-plugin). It's a different concept to what you are looking for - but offers endless options to access the Pico hardware.  
Additionally you may look at the (pure) [Moddable SDK](https://github.com/Moddable-OpenSource/moddable) - which is the foundation `node-red-mcu` is based on.

---

<div class="post-metadata">

**Author:** ![PizzaProgram](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/pizzaprogram/32/19431_2.png) [@PizzaProgram](https://discourse.nodered.org/u/PizzaProgram)\
**Post date:** [5 May 2024 09:40 UTC](https://discourse.nodered.org/t/nr2pico-u2if-python-to-js-help-wanted/87706/3 "2024-05-05T09:40:54Z")

</div>

> [@ralphwetzel](#):
>
> [`node-red-mcu-plugin`](https://flows.nodered.org/node/@ralphwetzel/node-red-mcu-plugin).

_Thanks for the hint! Yes, I know about that module. My detailed answer is [here ...](https://discourse.nodered.org/t/communicating-between-rpi-pico-via-usb/85294/11) so we do not spam this topic.  
 **My conclusion is:** it is not possible to do this with it. If I may be mistaken, please post a working flow to prove otherwise to the other topic! It would make me really happy._

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [3 August 2024 09:41 UTC](https://discourse.nodered.org/t/nr2pico-u2if-python-to-js-help-wanted/87706/4 "2024-08-03T09:41:51Z")

</div>

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.
