Trying to run python on NANOESP32

  • Install the Modulino MicroPython library (see Getting Started with Modulinos for detailed instructions)

  • click on this link - you get - Oops! There’s nothing here

please can Arduino provide instruction on how to install modulino for python

as required for program

from modulino import ModulinoVibro

fromtimeimport sleep

vibro = ModulinoVibro()

while True:

# Vibrate for 1 second

vibro.on(duration=1000)

sleep(1)

# Turn off

vibro.off()

sleep(1)

1 Like

@michaelbusfield is this the link you need?

Thanks for bringing this to our attention! I have submitted a formal report to the team responsible for the documentation on your behalf. I apologize for any inconvenience caused by the broken link.

The link is intended to target this page:

https://docs.arduino.cc/tutorials/modulino-thermo/how-general/

It might seem like the information in that tutorial won't be applicable to the Modulino Vibro, since it is located under the section of the documentation website dedicated to the Modulino Thermo. However, this tutorial is actually written to be generally applicable to all the Modulino Node products. The documentation team just arbitrarily placed it in the Modulino Thermo section, since the structure of the documentation website doesn't accommodate storing tutorials under a section that is general to a family of products.

micropython still not runing programs on nanoesp32

modulinio appears to be installed OK

MicroPython v1.27.0 on 2025-12-09; Arduino Nano ESP32 with ESP32S3
Type "help()" for more information.

raw REPL; CTRL-B to exit

OK[{"path": "/boot.py", "type": "file"}, {"path": "/benighn_oyster.py", "type": "file"}, {"path": "/lib", "type": "folder"}, {"path": "/lib/lsm6dsox.mpy", "type": "file"}, {"path": "/lib/micropython_hs3003", "type": "folder"}, {"path": "/lib/micropython_hs3003/hs3003.mpy", "type": "file"}, {"path": "/lib/micropython_hs3003/init.mpy", "type": "file"}, {"path": "/lib/modulino", "type": "folder"}, {"path": "/lib/modulino/buttons.mpy", "type": "file"}, {"path": "/lib/modulino/buzzer.mpy", "type": "file"}, {"path": "/lib/modulino/distance.mpy", "type": "file"}, {"path": "/lib/modulino/helpers.mpy", "type": "file"}, {"path": "/lib/modulino/joystick.mpy", "type": "file"}, {"path": "/lib/modulino/knob.mpy", "type": "file"}, {"path": "/lib/modulino/latch_relay.mpy", "type": "file"}, {"path": "/lib/modulino/lib", "type": "folder"}, {"path": "/lib/modulino/lib/vl53l4cd.mpy", "type": "file"}, {"path": "/lib/modulino/modulino.mpy", "type": "file"}, {"path": "/lib/modulino/movement.mpy", "type": "file"}, {"path": "/lib/modulino/pixels.mpy", "type": "file"}, {"path": "/lib/modulino/thermo.mpy", "type": "file"}, {"path": "/lib/modulino/vibro.mpy", "type": "file"}, {"path": "/lib/modulino/init.mpy", "type": "file"}]

MicroPython v1.27.0 on 2025-12-09; Arduino Nano ESP32 with ESP32S3
Type "help()" for more information.

when trying to run program

from modulino import ModulinoVibro
from time import sleep

vibro = ModulinoVibro()

while True:

Vibrate for 1 second

vibro.on(duration=1000)
sleep(1)

# Turn off
vibro.off()
sleep(1)

error message
>>> 
MicroPython v1.27.0 on 2025-12-09; Arduino Nano ESP32 with ESP32S3
Type "help()" for more information.
>>> 
raw REPL; CTRL-B to exit
>OKTraceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "modulino/__init__.py", line 9, in <module>
ImportError: no module named 'modulino.device_manager'
>
MicroPython v1.27.0 on 2025-12-09; Arduino Nano ESP32 with ESP32S3
Type "help()" for more information.
please help

why are modulino programs not working on nanoesp32?

"""
This example shows how to use the ModulinoThermo class to read the temperature and humidity from the Modulino.

If those values are temporarily unavailable, they will be set to None.

Initial author: Sebastian Romero (s.romero@arduino.cc)
"""

from modulino import ModulinoThermo
from time import sleep

thermo_module = ModulinoThermo()

while True:
temperature = thermo_module.temperature
humidity = thermo_module.relative_humidity

if temperature != None and humidity != None:
    print(f"🌡️ Temperature: {temperature:.1f} °C")
    print(f"💧 Humidity: {humidity:.1f} %")    
    print()
    
sleep(2)

error message
MicroPython v1.27.0 on 2025-12-09; Arduino Nano ESP32 with ESP32S3
Type "help()" for more information.
>>> 
raw REPL; CTRL-B to exit
>OKTraceback (most recent call last):
  File "<stdin>", line 9, in <module>
  File "modulino/__init__.py", line 9, in <module>
ImportError: no module named 'modulino.device_manager'
>
MicroPython v1.27.0 on 2025-12-09; Arduino Nano ESP32 with ESP32S3
Type "help()" for more information.
>>> 

As I know, Arduino NANOESP32 comes with a pre-installed Python interpreter which you have to enable. Check internet for the procedures.

Arduino has provided an IDE to create Python Script and then upload it into NANOESP32.

I played a bit few yeras ago; now I have forgotten almost everything. Currently, I am learning Pyhthon again using App Lab and Arduino UNO Q.

Thanks,

python programs are running perfetly on this nanoesp32 - it’s only modulino programs that are not working

Using UNO R4 or UNO Q check that your Modulino Module is workng.

already done - modulino vibro and thermo working fine with nanomatter running c/c++

Now, next step is to chcek your Modulino Module using UNO Q (if you have) which supports both Python Script and Arduino Sketch.


Figure-1: Arduino UNO Q Board

Tried on Arduino UNO Q

Arduino_modulino libray installed

Program

import time

from arduino.app_utils import App
from modulino import ModulinoThermo
from time import sleep

print("Hello world!")

def loop():
"""This function is called repeatedly by the App framework."""

You can replace this with any code you want your App to run repeatedly.

thermo_module = ModulinoThermo()

while True:
temperature = thermo_module.temperature
humidity = thermo_module.relative_humidity

if temperatue != None and humidity != None:
    printf(f" Temperature: {temperature:.1f}C")
    printf(f" Humidity: {humidity:.1f} %")
    print()

See: https://docs.arduino.cc/software/app-lab/tutorials/getting-started/#app-run

App.run(user_loop=loop)

error messages

Using CPython 3.13.9 interpreter at: /usr/local/bin/python
Creating virtual environment at: .cache/.venv
Activating python virtual environment
Traceback (most recent call last):
File "/app/python/main.py", line 4, in
from modulino import ModulinoThermo
ModuleNotFoundError: No module named 'modulino'
Activating python virtual environment
Traceback (most recent call last):
File "/app/python/main.py", line 4, in
from modulino import ModulinoThermo
ModuleNotFoundError: No module named 'modulino'
Activating python virtual environment
Traceback (most recent call last):
File "/app/python/main.py", line 4, in
from modulino import ModulinoThermo
ModuleNotFoundError: No module named 'modulino'
exited with code 1Using CPython 3.13.9 interpreter at: /usr/local/bin/python
Creating virtual environment at: .cache/.venv
Activating python virtual environment
Traceback (most recent call last):
File "/app/python/main.py", line 4, in
from modulino import ModulinoThermo
ModuleNotFoundError: No module named 'modulino'
Activating python virtual environment
Traceback (most recent call last):
File "/app/python/main.py", line 4, in
from modulino import ModulinoThermo
ModuleNotFoundError: No module named 'modulino'
Activating python virtual environment
Traceback (most recent call last):
File "/app/python/main.py", line 4, in
from modulino import ModulinoThermo
ModuleNotFoundError: No module named 'modulino'
exited with code 1

1. Have you connected the Modulino Module with the UNO Q board usin the Qwiic connector? Modulino Module is an I2C bus driven device handled by the MCU of the UNO Q. After making the connection, please take a photo with your mobile camera and post it here.

2. Now perform the following experiment to understnaf how MCU sends signal to MPU using Router Bridge for onward printin on the Console>>Python.

Step - 6 of this tread.

Repeated below:
6. Passing ADC data from MCU to MPU using Router bridge. Connect the Pot with MCU as per Fig-1.


Figure-1:

Python Script for MPU (tested)

from arduino.app_utils import *
import time

last_print = 0
interval = 0.1  # seconds between loop checks

# A container to hold the latest ADC value
latest_adc = None

# This function will be called automatically when MCU sends notify
def on_adc(value):
    global latest_adc
    latest_adc = value

# Subscribe to MCU notifications
Bridge.provide("adc_data", on_adc)

def loop():
    global last_print, latest_adc
    current_time = time.time()
    
    # Check every 100ms if there is new data
    if latest_adc is not None and current_time - last_print >= 1:
        voltage = latest_adc * (3.3 / 1023.0)
        print(f"ADC: {latest_adc}, Voltage: {voltage:.3f} V") #shows on: Python console
        last_print = current_time

App.run(user_loop=loop)

Arduino Sketch for MCU (tested)

#include "Arduino_RouterBridge.h"

void setup() 
{
    analogReadResolution(10); 
    Monitor.begin();  
    Bridge.begin();           
}

void loop() 
{
    int adc = analogRead(A0);        
    Bridge.notify("adc_data", adc);   
    Monitor.println("Seding data to MPU."); //shows on: Serial Monitor of IDE and Console
    delay(1000);                       
}

3. Now, develop app (application = script + sketch) using App Lab to show the readings of he Modulino onto Console>>Serial Monitor at 1-sec interval.

Thaks for this - program did run but then appeared to crash - eror message -Using CPython 3.13.9 interpreter at: /usr/local/bin/python
Creating virtual environment at: .cache/.venv
Activating python virtual environment
Traceback (most recent call last):
File "/app/python/main.py", line 16, in
Bridge.provide("adc_data", on_adc)
^^^^^^
NameError: name 'Bridge' is not defined
Activating python virtual environment
Traceback (most recent call last):
File "/app/python/main.py", line 16, in
Bridge.provide("adc_data", on_adc)
^^^^^^
NameError: name 'Bridge' is not defined
Activating python virtual environment
Traceback (most recent call last):
File "/app/python/main.py", line 16, in
Bridge.provide("adc_data", on_adc)
^^^^^^
NameError: name 'Bridge' is not defined
Activating python virtual environment
Traceback (most recent call last):
File "/app/python/main.py", line 16, in
Bridge.provide("adc_data", on_adc)
^^^^^^
NameError: name 'Bridge' is not defined
exited with code 1

Channge the above line to the following and try again:

#include <Arduino_RouterBridge.h>

If the above does not work, do the following:

Now, you have do the trouble beginning the execution of small basic script.
1. Use App Lab to execute the following app.
Script: to show the message Forum on Console>>Python at every 1-sec inerval.

Sketch: to show the A0-voltage (Fig-1, post #14) on Console>>Serial Monitor at 1-sec interval.

2. Modify both the script and the sketch from Step-1 so that the MCU uses Bridge.notify() to send A0-voltage, and the script uses Bridge.provide() to collect the data at 1-second intervals.

simple C/C++ program on Arduino UNO Q working fine

#include <Arduino_RouterBridge.h>
#include <Modulino.h>

// Create object instance
ModulinoThermo thermo;

// Global Variables
float celsius = 0;
float humidity = 0;

void setup(){
// Initialization of the serial port, modulino object and thermo one

Modulino.begin();
thermo.begin();

Monitor.begin();
}

void loop(){
celsius = thermo.getTemperature();
humidity = thermo.getHumidity();

Monitor.print("Temperature (C) is: ");
Monitor.println(celsius);

Monitor.print("Humidity (rH) is: ");
Monitor.println(humidity);

delay(1000);
}

Still do not undersand why the modulino python programs are not working on devices such as NANOESP32

Your duplicate topic has been closed

Please do not duplicate your questions as doing so wastes the time and effort of the volunteers trying to help you as they are then answering the same thing in different places.

Please create one topic only for your question and choose the forum category carefully. If you have multiple questions about the same project then please ask your questions in the one topic as the answers to one question provide useful context for the others, and also you won’t have to keep explaining your project repeatedly.

Repeated duplicate posting could result in a temporary or permanent ban from the forum.

Could you take a few moments to Learn How To Use The Forum

It will help you get the best out of the forum in the future.

Thank you.

I don't know python sorry..
From post #4 I see you appear to be missing device_manager.py, this was added to the git under branch tag motor..
I do not see it listed in the package.json and I'm thinking this is why you're missing it??
Manually download it and place it in the /lib/modulino/ folder might get you working..

good luck.. ~q

Please Arduino update the Micropython package installer for Modulino so that it adds all files needed.

I can find a device_manager.py file online but its not clear how to get this into the .mpy format required

The version of the Modulino package loaded by the Arduino Micropython package installer is clearly out of date.

the instructions and developer instructions provided on

GitHub - arduino/arduino-modulino-mpy: A MicroPython package to read data from Modulinos and control their behaviour. · GitHub

do not work

Please can Arduino update all so that NANOESP32 can be used with Modulinion in Python

Thanks to Sebastian Romero for updating the Arduino Modulino package. Python Modulino programs are now working on NANOESP32.

2 Likes