AnthonyKNorman / Xiaomi_LYWSD03MMC_for_HA

Collecting data via Bluetooth from the Xiaomi LYWSD03MMC Temperature Display using ESP32 running Micropython
52 stars 7 forks source link

OsError28 #4

Open robert4y opened 4 years ago

robert4y commented 4 years ago

Hello, I don't know what the problem is, but once in a few days I have an oserror28 error and I have to upload everything again. oserror28_1

AnthonyKNorman commented 4 years ago

The line causing the error is f.write(timestamp() + ' ' + message +'\n') and the OSError 28 is "No space left on device". The log file is filling up your device. Use uos.listdir() to list the files on your device. You should see something like this:

['boot.py', 'readlog.py', 'ble.py', 'mqtt.py', 'main.py', '20200716ble.log', '20200717ble.log', '20200718ble.log']

The start of the logfile names are the date 2020-07-18 etc. There is a routine that removes files more than three days old.

if you run

>>> machine.RTC().datetime()
(2020, 7, 18, 5, 8, 39, 22, 483894)

you should see the current time and date. If you don't, it may be that you are not connected to the internet and your RTC is not being set.

Can you let me know what you get?

robert4y commented 4 years ago

oserror28c

amovilar commented 4 years ago

image

Same here. Deleting the ble.log start working again

AnthonyKNorman commented 4 years ago

I think you are using an out of date version. As you see from my example, the latest version produces daily log files and cleans up after itself. Try the latest files and let me know how you get on.

desarrolloddol commented 4 years ago

Hello,

The last source from ble.py always creates a file called ble.log. No value is set for parameter fname in function "debug" so always is creating a file with the same name

AnthonyKNorman commented 4 years ago

You are correct. I have a bug. Leave it with me.

On Mon, Jul 20, 2020 at 8:43 AM desarrolloddol notifications@github.com wrote:

Hello,

The last source from ble.py always creates a file called ble.log. No value is set for parameter fname in function "debug" so always is creating a file with the same name

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/AnthonyKNorman/Xiaomi_LYWSD03MMC_for_HA/issues/4#issuecomment-660861386, or unsubscribe https://github.com/notifications/unsubscribe-auth/AEV6CXOXSONV3EVN4ICQQW3R4PYRJANCNFSM4O7THGBA .

AnthonyKNorman commented 4 years ago

New version of ble.py uploaded

robert4y commented 4 years ago

I uploaded a new ble.py file and now it looks ok. Thanks.

oserror28e

desarrolloddol commented 4 years ago

Hello Anthony,

With the latest update the file is created with a filename according to the current date. Despite of this, is needed to purge the logs to avoid the disc full problem.

Thank you.

AnthonyKNorman commented 4 years ago

New version of mqtt.py should clan up after itself,

AnthonyKNorman commented 4 years ago

OK. Try the latest version of ble.py