Enviro urban, micropython & Chromebook

Hi,

I’m trying to connect to an Enviro Urban using VS Code on a Chromebook.

The device is connected as /dev/ttyACM0 and the permissions are set correctly.

I can view and edit the files on the device, but I can’t run any commands in the REPL.

I’ve tried this before on a Windows laptop and when I issue:

import enviro

I get a banner displayed in the REPL when it loads the library.

Nothing is happening on the Chromebook. I have also tried on a Pi400 using Thonny and I get the same behaviour.

I’ve attached a screenshot.

Any suggestions on what to try?

Thanks
Steve

“Nothing” is not correct: the code is complaining about a method not available in the module.

Try

import enviro
dir(enviro)

This should give you a list of all the methods (and some more stuff) of the enviro module. Seems that upload_readings is not a method of this module?!

The ‘nothing’ refers to the fact that no banner appears when importing the enviro module, which I do get in VS Code on a Windows laptop.

The method is available in that library, this is snippet from main.py on the board:

# check if we've reached the time to upload our cached data
cache_file_count = enviro.cached_upload_count()
if cache_file_count >= config.upload_frequency:
  logging.info(f"> {cache_file_count} cache files need uploading")

  enviro.upload_readings()

enviro.sleep(config.reading_frequency)

Running dir(enviro) gave me this:

It seems it is picking up a different version of the enviro-module. If you look at your output, there is no upload_readings in the list. You should check the system if there are multiple versions on the device.

What firmware version are you running on the board?