0

Clue_Plotter Problem
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

Clue_Plotter Problem

by geotek on Wed May 06, 2020 7:44 pm

Greetings:

Downloaded CircuitPython and libraries for plotting,etc.
Additional files loaded for plotting : Clue-Plottter changed to code.py / Plot_Source and Plottter.py
I get a few errors reported back to the display screen

File "code.py", line 47 in <module>
File "adafruit_clue.py", line 66, in <module>
ImportError: no module named 'adafruit_bmp280'

code done running. waiting for reload

-------------------------------------------------------------------------------------------------------------------------------------------------
I don't see any obvious problem in line 47 or line 66
The file adafruit_bmp280 does indeed appear in the LIB folder in drive D:
--------------------------------------------------------------------------------------------------------------------------------------------------
Has anyone come across this problem?
Any ideas for solving this problem.
Any help would be greatly appreciated!
thanks
Tom

geotek
 
Posts: 45
Joined: Thu Mar 07, 2013 1:39 pm

Re: Clue_Plotter Problem

by dastels on Wed May 06, 2020 9:41 pm

Double check that adafruit_bmp280.mpy is in CIRCUITPY/lib. CircuitPython can't find it for some reason.

I just followed the instructions and it worked fine.

You might have versioning problems. I suggest you install the latest version of CircuitPython for the CLUE from https://circuitpython.org/board/clue_nrf52840_express/, as well as the latest version of the required libraries from https://circuitpython.org/libraries. (the 5.X bundle).

Dave

dastels
 
Posts: 6459
Joined: Tue Oct 20, 2015 3:22 pm

Re: Clue_Plotter Problem

by geotek on Thu May 07, 2020 11:50 am

Greetings:

Thanks Dave
I reloaded the clue.py and bmp_280.py files from the source you provided and all works great.
Thanks again for your help
Tom

geotek
 
Posts: 45
Joined: Thu Mar 07, 2013 1:39 pm

Re: Clue_Plotter Problem

by dastels on Thu May 07, 2020 1:16 pm

Excellent!

Dave

dastels
 
Posts: 6459
Joined: Tue Oct 20, 2015 3:22 pm

Re: Clue_Plotter Problem

by kevinjwalters on Tue May 12, 2020 6:06 am

The first time I copied the libraries in I copied adafruit_bme280.mpy (wrong one with an e) rather than adafruit_bmp280.mpy (right one with a p).

kevinjwalters
 
Posts: 960
Joined: Sun Oct 01, 2017 3:15 pm

Re: Clue_Plotter Problem

by geotek on Tue May 12, 2020 8:36 am

Greetings

Once I recopying the correct files, it worked like a charm.
The Clue is pretty cool little board with a lot of potential
Thanks
Tom

geotek
 
Posts: 45
Joined: Thu Mar 07, 2013 1:39 pm

Re: Clue_Plotter Problem

by dastels on Tue May 12, 2020 9:56 am

Kevin, I've done that as well.

Dave

dastels
 
Posts: 6459
Joined: Tue Oct 20, 2015 3:22 pm

Re: Clue_Plotter Problem

by RobertI on Fri Jul 03, 2020 10:36 am

Trying this as a first Clue project.

Libraries all in.
It's running.
Draws the frame.

But it just gets a MemoryError trying to allocate 161 bytes at code.py 162/line 786 of plotter.py.

Any suggestions? I'm so near yet so far...

RobertI
 
Posts: 8
Joined: Fri Jul 03, 2020 10:32 am

Re: Clue_Plotter Problem

by kevinjwalters on Fri Jul 03, 2020 10:40 am

I have some familiarity with this project, I'll run it up on 5.3.0 and latest libs to see how it behaves.

@Robertl What version of CircuitPython and library bundle are you using?

kevinjwalters
 
Posts: 960
Joined: Sun Oct 01, 2017 3:15 pm

Re: Clue_Plotter Problem

by RobertI on Fri Jul 03, 2020 11:34 am

"some familiarity" indeed. Thank you.

I'm using the most recent uploads of both - from adafruit-circuitpython-bundle-5.x-mpy-20200703.

Also running it from a Mac - am aware that the mac OS sometimes sticks BS in the files...

Thank you!

Robert

RobertI
 
Posts: 8
Joined: Fri Jul 03, 2020 10:32 am

Re: Clue_Plotter Problem

by kevinjwalters on Fri Jul 03, 2020 11:58 am

I get this too on same libraries.

Code: Select all | TOGGLE FULL SIZE
Adafruit CircuitPython 5.3.0 on 2020-04-29; Adafruit CLUE nRF52840 Express with nRF52840
>>>
soft reboot

Auto-reload is on. Simply save files over USB to run them or enter REPL to disable.
code.py output:
Traceback (most recent call last):
  File "code.py", line 195, in <module>
  File "code.py", line 162, in popup_text
  File "plotter.py", line 786, in info
  File "adafruit_display_text/label.py", line 127, in __init__
  File "adafruit_display_text/label.py", line 271, in _update_text
  File "adafruit_display_text/label.py", line 167, in _create_background_box
MemoryError: memory allocation failed, allocating 1616 bytes


There's a problem somewhere between the plotting application and one of its libraries. For now, I would advise using an older version of just the lib/adafruit_display_text/label.py library as a workaround. The one I did the majority of my development and testing on is adafruit-circuitpython-bundle-5.x-mpy-20200327.zip found in https://github.com/adafruit/Adafruit_Ci ... g/20200327 . I've tried this (see below for how I renamed current version) and can confirm it works.

plotter-memoryerror-lib-workaround-using-20200327-libs.png
lib/adafruit_display_text directory showing 20200327 label.mpy with newer version renamed
plotter-memoryerror-lib-workaround-using-20200327-libs.png (12.25 KiB) Viewed 75 times


I also tried commenting out popup_text() for the Button Guide which appeared to help at first but then the text after that in the plotter went a bit crazy position-wise so this does not help. I'll dig a bit deeper here to see what's going on here.

kevinjwalters
 
Posts: 960
Joined: Sun Oct 01, 2017 3:15 pm

Re: Clue_Plotter Problem

by RobertI on Fri Jul 03, 2020 12:22 pm

You are a fine and splendid person.

RobertI
 
Posts: 8
Joined: Fri Jul 03, 2020 10:32 am

Re: Clue_Plotter Problem

by RobertI on Fri Jul 03, 2020 12:35 pm

All working fine now. Except there is a hilarious glitch in the temperature plotting, the start of every sweep is much lower than later; but I say this as an aside, because the purpose of the program is to try out the device, and the device is great.

RobertI
 
Posts: 8
Joined: Fri Jul 03, 2020 10:32 am

Re: Clue_Plotter Problem

by kevinjwalters on Fri Jul 03, 2020 12:47 pm

I believe it's how the sensor works, my hypothesis for these very small variations is described on CLUE Sensor Plotter in CircuitPython: Sensors: Temperature. Happy plotting.

BTW, I put in a ticket for the MemoryError, if you're interested you can track GitHub: adafruit/Adafruit_CircuitPython_Display_Text: Consider offering control over creation of background bitmap to reduce memory usage #61.

kevinjwalters
 
Posts: 960
Joined: Sun Oct 01, 2017 3:15 pm

Re: Clue_Plotter Problem

by RobertI on Fri Jul 03, 2020 12:54 pm

Thank you, I will. My own code next tho'

RobertI
 
Posts: 8
Joined: Fri Jul 03, 2020 10:32 am

Please be positive and constructive with your questions and comments.