EmonPi error when login to emoncms

Hey guys, first time on here. I’m an electrician in Australia. I have purchased an EmonPi + EmonTx (as well as some other gear) to do some energy monitoring on a commercial building. I’ve got some Arduino experience and have a Pi3 Kodi box but that’s as far as my knowledge in this field goes.

So the problem is when I boot the emonpi and go to device IP (either wired, wireless or wireless AP) - once I login to emoncms I get the following error:

Warning : mysqli::query(): (HY000/1194): Table ‘device’ is marked as crashed and should be repaired in /var/www/emoncms/Modules/device/device_model.php on line 267

Fatal error : Uncaught Error: Call to a member function fetch_object() on bool in /var/www/emoncms/Modules/device/device_model.php:268 Stack trace: #0 /var/www/emoncms/Modules/device/device_model.php(229): Device->load_list_to_redis(1) #1 /var/www/emoncms/Modules/device/device_model.php(219): Device->get_list_redis(1) #2 /opt/emoncms/modules/demandshaper/demandshaper-module/demandshaper_model.php(31): Device->get_list(1) #3 /opt/emoncms/modules/demandshaper/demandshaper-module/demandshaper_menu.php(20): DemandShaper->get_list(Object(Device), 1) #4 /var/www/emoncms/core.php(193): require(’/opt/emoncms/mo…’) #5 /var/www/emoncms/index.php(336): load_menu() #6 {main} thrown in /var/www/emoncms/Modules/device/device_model.php on line 268

Any help on this one?

My goal is to eventually monitor 3 phase energy consumption, single phase hot water energy consumption, solar production and EV charging. However I’m no where near that with this SQL error.

Thanks and greetings from Australia.

Welcome, Matt, to OEM.

I’m afraid I can’t help with the emonPi, but one of my colleagues should be able to help you. Unfortunately, you’ll have to wait because they’ve probably gone to bed. (It’s 00:45 local time here in the UK as I write.)

When it comes to your 3-phase installation, bear in mind that all the emon kit is designed with the UK domestic power system in mind, so the sketch in your emonTx will need replacing by the 3-phase one (posted here: Update to 3-Phase PLL sketch - #15 by Robert.Wall) unless all your loads are balanced.

Is this a new item? Can you get to the admin page or is that all you get? If it is try <yourIP>/emoncms/admin/view.

Cheers thanks, I do plan on using 3 phase sketch, I appreciate the link.

Hey borpin yeah it is brand new, this is my first attempt at getting it setup. That error is all I get. If I haven’t tried to login and navigate to admin view - I get authentication error. If I attempt to login I get the usual error, trying to navigate to admin view after that brings up same error posted in first post.

I’ve tried 2 different PCs (Win 7 & Win 10) just to confirm no weird browser compatibility - still same original error.

Any ideas at all? Should I attempt to get a replacement?

Most odd. My first suggestion then is to get a fresh image and flash that to the card.

When it first boots, you do need to be really patient as it does a whole load of updates which can take quite a while. Rebooting mid update could be the issue.

OK so my existing build on the SD card is 17Oct19 so I don’t think flashing the same image will be much help? When I first booted and was reading around I had it on for around 30mins. Any other ideas? Should I just get a replacement? I’m running out of time to get the unit installed and commissioned. Thanks for your help.

It can’t harm. It just may have been a bad flash.

Might have been long enough - depends on your internet speed as it is doing updates. You can monitor it via htop, once it settles processor use will drop to pretty much zero.

Quickest thing to try is to re-flash card.

Ask for one, but try the flash in the meantime.

Hey so thanks for your help, re-flash has worked. Will get to customising now for what I need it to do :sunglasses:

1 Like