Search found 5 matches

by Khyrtsi
Sun Mar 19, 2017 4:29 pm
Forum: General Discussion and Questions
Topic: Catch all exceptions, what exception was raised?
Replies: 1
Views: 2303

Catch all exceptions, what exception was raised?

If I catch all exceptions, how can I see what exception was raised?

I know that it's normally considered bad practise to catch all, but I would like to log the exception to somewhere (network or lcd) and not just freeze.
by Khyrtsi
Wed Nov 23, 2016 8:31 pm
Forum: Programs, Libraries and Tools
Topic: localization of date/time/decimal
Replies: 2
Views: 4560

Re: localization of date/time/decimal

Data should be localized in UI. If you have a "dumb" sensornode then it should report values in machine readable format. If it has a user interface then it should localize data.

I consider mcu's more suitable for dumb sensor nodes, but I'm no expert on them.
by Khyrtsi
Tue Nov 22, 2016 12:30 pm
Forum: General Discussion and Questions
Topic: Can a python script know when webrepl is open?
Replies: 5
Views: 6856

Re: Can a python script know when webrepl is open?

It should be relatively easy to tell, if someone is connected, by calling uos.dupterm(). That's what webrepl does. If someone is connected, it will return True. That assume showever, that the only two possible REPL connections are USB and webrepl. Update: Just tested that. On REPL, not not uos.dupt...
by Khyrtsi
Sun Nov 20, 2016 9:23 pm
Forum: General Discussion and Questions
Topic: Can a python script know when webrepl is open?
Replies: 5
Views: 6856

Re: Can a python script know when webrepl is open?

That's similar how I currently do it. But it does requires to physically go to the sensor, which I would very much like to avoid:)
by Khyrtsi
Sun Nov 20, 2016 3:36 pm
Forum: General Discussion and Questions
Topic: Can a python script know when webrepl is open?
Replies: 5
Views: 6856

Can a python script know when webrepl is open?

Can I somehow know in my script when someone is connected via webrepl? My use case is a sensor node that measures and then deep sleeps for a minute, and repeats. I would like to check if someone has connected via webrepl before the node goes to deep sleeps and if there is a connection then stop and ...