Open Chiny91 opened 4 years ago
I noticed that yesterday! I used a pi 2b to write this on, never had any crashes, I wonder if you had an sd card problem or something. Could be anything, power supply spikes, who knows.
I'm pretending the minimum price bug doesn't exist. I've fixed it in the new thing I'm working on so I suppose I will roll it out to this in due course! 😛
I am an Octopus customer and came accros your work whilst researching the Agile tariff. I have now followed your install instructions on a Pi Zero W with red inkyphat display. Running "python3 octoprice_main_inky.py" gave a couple of import errors and had to do the following before it would run: pip3 install inky pip3 install font_fredoka_one. Thank you for your contribution!
Welcome to Agile :)
The step: "curl https://get.pimoroni.com/inky | bash" in the instructions ought to have done the install of inky and the font, but it is owned/maintained by pimoroni so if you did run it, perhaps it may have failed or been down somehow at the time.
Thank you. I think your software will be getting a lot of attention!
I have had this running a while now. Tempted to fix the min price bug too. The other issue I have is regular failure to have prices available when the crontab entry runs. Tempted to create a store prices which can be called multiple times but will only insert if not already exists.
I have had this running a while now. Tempted to fix the min price bug too.
Yeah its bugging me now too - I'll get right on it ;)
The other issue I have is regular failure to have prices available when the crontab entry runs. Tempted to create a store prices which can be called multiple times but will only insert if not already exists.
You can just run it multiple times in cron, say... 15 17,19,20,21 * /usr/bin/python3 store_prices.py > /home/pi/cron2.log
This will run at 15 mins past 5, 7, 8 and 9pm
My only advice is don't do it more than a few times a day. I think the above ought to work fine. If you do look at the insert if not exists, then maybe you could combine that with making sure not to make duplicates in the sqlite (currently it does, which isn't a massive issue, but not exactly desirable). That would be useful for me.
Cheers!
If you do look at the insert if not exists
Hey buddy, if it helps you, this is the SQL I've used to achieve that same result. Hopefully copypastable. Linky :)
I have had this running a while now. Tempted to fix the min price bug too.
Done :) Nice - we have negative pricing tonight too, so I'm seeing the right minimum value, -4.2p in 23hrs Give me a shout if I've messed any(every)thing up but it should just need the new octoprice_main_inky.py file pulling down.
Yes, that fix works fine for me, (-4.6p at 1500 bst). Ah, just had the Octopus email re a "double plunge"... now, what will I switch on ?
Nice work.
Yes, that fix works fine for me, (-4.6p at 1500 bst). Ah, just had the Octopus email re a "double plunge"... now, what will I switch on ?
.... everything :)
needed manual installs of
pip3 install inky pip3 install font_fredoka_one pip3 install pytz pip install smbus2
but now getting this
Traceback (most recent call last):
File "/usr/local/lib/python3.7/dist-packages/inky/eeprom.py", line 100, in read_eeprom
from smbus2 import SMBus
ModuleNotFoundError: No module named 'smbus2'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "octoprice_main_inky.py", line 25, in <module>
inky_display = InkyPHAT("red")
File "/usr/local/lib/python3.7/dist-packages/inky/phat.py", line 72, in __init__
v_flip=False)
File "/usr/local/lib/python3.7/dist-packages/inky/inky.py", line 86, in __init__
self.eeprom = eeprom.read_eeprom(i2c_bus=i2c_bus)
File "/usr/local/lib/python3.7/dist-packages/inky/eeprom.py", line 102, in read_eeprom
raise ImportError('This library requires the smbus2 module\nInstall with: sudo pip install smbus2')
ImportError: This library requires the smbus2 module
Install with: sudo pip install smbus2
@bertybassett did you install the inky phat library?
"curl https://get.pimoroni.com/inky | bash"
yes
Did it fail? It seems like it missed the install for a lot of things..
sudo pip3 install smbus2 fixed it and I can confirm that it is now working
I must say the inky script asked if I wanted a full install examples and documents and I said no maybe that caused it to fail.
Yeah looking down the list of things the pimoroni script does, I think if it fails you will get a lot of missing stuff. Try running it again and see if you can spot any errors?
You can literally put https://get.pimoroni.com/inky into a browser, save the file, open it as text and see how much stuff it does...quite a lot!
don't worry it is working now
Good stuff!
Congratulations @pufferfish-tech on being officially noticed by Octopus Energy. Now there is absolutely no excuse for not fixing the bugs, sorting one or two sub-optimal points 😄
Octopus Energy blog.
Incidentally, Octopus Energy show a Raspberry Pi Zero which I find 100% reliable, compared to my daily crash of an older R Pi 2b.