0

PyPortal thermometer.py won't run
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

Re: PyPortal thermometer.py won't run

by loggerman on Mon Jun 17, 2019 2:03 pm

Hi, ok, thanks for that, it turned out to be the same USB port ID for me:

/dev/ttyACM0

So this worked for REPL, which gives me much more debug capability:

picocom -b 115200 /dev/ttyACM0

But I still have this problem of it not waking up the display properly. I can move my hand around as much as I want, but the display stays asleep (but still pumping data to AIO). At other times, it suddenly wakes up and starts getting warm, with the numerals turning to red as it approaches 90 degrees F. Is the default behavior such that it should just wake up with a hand wave? Might I have a defective light sensor??

Tks, AB

loggerman
 
Posts: 10
Joined: Wed Jun 12, 2019 6:51 pm

Re: PyPortal thermometer.py won't run

by adafruit_support_carter on Mon Jun 17, 2019 2:35 pm

Since you are connecting to the serial monitor, you should be able to see the serial outputs. The sketch should be printing out the light sensor values:
https://github.com/adafruit/Adafruit_Le ... ter.py#L81
So you can look at that as a way to see if the light sensor seems to be behaving OK.

adafruit_support_carter
 
Posts: 12969
Joined: Tue Nov 29, 2016 2:45 pm

Re: PyPortal thermometer.py won't run

by loggerman on Tue Jun 18, 2019 12:05 pm

Hi, so being able to see the REPL prompt certainly does solve a lot of problems. It turns out the light sensor is working, and I can see the light values being printed to the terminal screen. I also see in the code where if the value gets below 1000, it causes the backlight to turn on.

The problem seems to be that it is very difficult to get the light level below 1000, even in a dimly lit room. Even pinching the board light sensor between my fingers would barely get it below 1000, so I'm not sure why you would put in the instructions that a simple wave of the hand would trigger the backlight to turn on.

It definitely doesn't behave like that, so might I perhaps have a light sensor that is way out of spec (or defective)?

Also, is there a board layout picture somewhere that shows where exactly the light sensor is? I'm not able to get it anywhere near zero, so I'm not sure if I am actually blocking the light properly.

I increased the trigger threshold to 2000, so at least this improves the sensitivity.

One other question I have is about the AIO system - I cannot seem to get the time axis to appear on the x-axis. I can see that it seems to start doing something automatically as the time span gets longer, but do we have any control over that as a user?

And thank you for bearing with me on this; I was worried that I had a bad board, so it is nice to know it is all working at this point. Now I can begin my exploration of CircuitPython and AIO to see if it is the system we will use for our IoT projects.

Regards, AB

loggerman
 
Posts: 10
Joined: Wed Jun 12, 2019 6:51 pm

Re: PyPortal thermometer.py won't run

by adafruit_support_carter on Tue Jun 18, 2019 12:29 pm

Let's keep working on whatever is happening with the light sensor. Here's some info about the location:
https://learn.adafruit.com/adafruit-pyp ... nsors-2-11
And here's a photo showing the location:
https://learn.adafruit.com/assets/71972

You can keep using the current program to have a print out of the sensor value. So keep trying that and now that you know for sure where the sensor is, try covering it with a finger, then removing, etc. You should definitely see a value change doing that.

adafruit_support_carter
 
Posts: 12969
Joined: Tue Nov 29, 2016 2:45 pm

Re: PyPortal thermometer.py won't run

by loggerman on Tue Jun 18, 2019 1:30 pm

Hi, ok, so the light sensor is exactly where I thought it was.

There is no question that the values change when the light sensor is blocked, but there is not a hope (on mine) that waving a hand in front of it would be enough to trigger the backlight. Perhaps if you adjusted the trigger sensitivity and the refresh rate you could make that happen, but there's no way it will do it with the default settings (on mine).

So either the instructions are wrong or I have a light sensor that is behaving out of spec?

My Unblocked Light Value: 15712 (no sunshine directly in room)

Regards, AB

loggerman
 
Posts: 10
Joined: Wed Jun 12, 2019 6:51 pm

Re: PyPortal thermometer.py won't run

by adafruit_support_carter on Tue Jun 18, 2019 1:44 pm

Yep, you may need to adjust the threshold level for your specific environmental lighting. You've already tried that:
I increased the trigger threshold to 2000, so at least this improves the sensitivity.

but maybe just need to refine the actual value a little more. You can use the test program as way to see the actual values and come up with a better value for the threshold. Without anything in front = A. With finger covering = B. Set threshold somewhere between A and B and see what happens.

adafruit_support_carter
 
Posts: 12969
Joined: Tue Nov 29, 2016 2:45 pm

Re: PyPortal thermometer.py won't run

by loggerman on Tue Jun 18, 2019 4:17 pm

One other question I have is about the AIO system - I cannot seem to get the time axis to appear on the x-axis. I can see that it seems to start doing something automatically as the time span gets longer, but do we have any control over that as a user?

loggerman
 
Posts: 10
Joined: Wed Jun 12, 2019 6:51 pm

Re: PyPortal thermometer.py won't run

by adafruit_support_carter on Tue Jun 18, 2019 5:06 pm

You have some control over the x-axis via the drop down when in edit mode:
aio.jpg
aio.jpg (21.26 KiB) Viewed 65 times

See if that will do what you want. But the plot may also look a bit odd until there are enough data points to actually fill out the entire time window.

adafruit_support_carter
 
Posts: 12969
Joined: Tue Nov 29, 2016 2:45 pm

Re: PyPortal thermometer.py won't run

by arteiot on Tue Jun 18, 2019 5:19 pm

perfect, thank you!
arteiot
 
Posts: 7
Joined: Sat Sep 21, 2013 7:30 pm

Please be positive and constructive with your questions and comments.