Xiaomi_LYWSD03MMC_for_HA icon indicating copy to clipboard operation
Xiaomi_LYWSD03MMC_for_HA copied to clipboard

OsError28

Open robert4y opened this issue 4 years ago • 11 comments

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

robert4y avatar Jul 18 '20 08:07 robert4y

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?

AnthonyKNorman avatar Jul 18 '20 08:07 AnthonyKNorman

oserror28c

robert4y avatar Jul 19 '20 08:07 robert4y

image

Same here. Deleting the ble.log start working again

amovilar avatar Jul 19 '20 15:07 amovilar

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.

AnthonyKNorman avatar Jul 20 '20 07:07 AnthonyKNorman

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

desarrolloddol avatar Jul 20 '20 07:07 desarrolloddol

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

On Mon, Jul 20, 2020 at 8:43 AM desarrolloddol [email protected] 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 avatar Jul 20 '20 07:07 AnthonyKNorman

New version of ble.py uploaded

AnthonyKNorman avatar Jul 20 '20 08:07 AnthonyKNorman

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

oserror28e

robert4y avatar Jul 20 '20 08:07 robert4y

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.

desarrolloddol avatar Jul 20 '20 08:07 desarrolloddol

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

AnthonyKNorman avatar Jul 23 '20 07:07 AnthonyKNorman

OK. Try the latest version of ble.py

AnthonyKNorman avatar Jul 27 '20 07:07 AnthonyKNorman