Tuesday, 20 June 2017

Epever/Epsolar output to InfluxDB/Grafana

I setup reporting for my EPever solar charge controller a while ago using  using the following guide at sporadic projects.  It works but have been hankering for something a little more/different and saw a posting recently of someone using grafana and influxdb to report on their PIP based solar setup so i set about recreating this and in all honesty it wasn't as bad as i thought and after a few days i've gotten something up and running.

The first step was setting up my pi, i decided to reuse a aging pi1 which caused some issues as i couldn't install things from the standard repo's so it needed a little more tinkering.  I documented this as i went so i hope this helps others using it on a pi1 also.

The below shall download a precompiled influxdb setup and install it.  It will then add a custom repo to your sources list and install grafana and then start it up and enable it at startup.  Lastly it shall install php and the curl library for php and then install the influxdb library for php using composer.  Socat is optional but if your using one of my rs485 to wifi devices you shall need it to connect to the serial port over the network, if your using a physical connection you can update the code accordingly with the correct serial port.

wget https://dl.influxdata.com/influxdb/releases/influxdb_1.2.0_armhf.deb
sudo dpkg -i influxdb_1.2.0_armhf.deb

echo "deb https://dl.bintray.com/fg2it/deb-rpi-1b jessie main" | sudo tee -a /etc/apt/sources.list.d/grafana.list
sudo apt-get update
sudo apt-get install grafana

sudo /bin/systemctl daemon-reload
sudo /bin/systemctl enable grafana-server
sudo /bin/systemctl start grafana-server

sudo apt-get install socat

sudo apt-get install php5-fpm
sudo apt-get install php5-curl

So you can get to the influxdb web interface you need to first enable it with the below.
sudo nano /etc/influxdb/influxdb.conf
Change enabled = false to enabled = true under the [admin] section.

Next you need to conenct to the wifi serial adaptor so this is done using socat which we installed earlier
sudo socat pty,link=/dev/ttyUSB21,unlink-close=0,raw,echo=0 tcp:WirelessDeviceIPAddress:23&
sudo chmod 777 /dev/ttyUSB21

Once this is done you shall need to launch a web browser and go to

http://IP of your Pi:8083/

from here you can create a db called powerwall, it's self explanatory and very easy.  Then create a user called root with password root for the DB, i created it as an admin but that is optional.

Once you have done this you shall need to go to the web interface of the new grafana installation at the following address

http://IP of your Pi:8083

From here you configure the datasource as per below

Once this is done the database and grafana initial configuration is done.  You now need to download a few files from github.  I use the php library which toggio kindly wrote which made this possible, i'd say easier but possible is a more honest answer.


Place the files into one directory together and run

php logger.php

If it works it should print out the current realtime and statistical information.  If you receive a could not connect error then please check that socat is still running correctly, i find it can drop out for.  If it's working ok then put it into crontab to run as frequently as required.

Lastly you then need to go back to grafana and start to create some dashboards which is simple and very wyswig.  If you want/need an example let me know and i can upload my dashboard.

Tuesday, 16 August 2016

I've two solar charge controllers from EPsolar or EPever as they are sometimes known. They are great and have a COM port for monitoring the performance of the panels and state of the battery etc but it's a pain to drag the laptop out and hook things up just to check the status. The COM port is a RJ45 port which uses the RS485 standard so i investigated commercial offerings but they were extremely expensive and as this was just to make things convenient for a personal home product i didn't fancy paying £50 out for the

I began to investigate doing this myself and using some off the shelf components and custom firmware from the guys at esp-link i was able to come up with the design you can see in the picture.

I've made both a instructable available here and also a set of YouTube videos on the procedure.



Tuesday, 20 October 2015

Hi guys, I've kindly been sent a new gadget to have a look at by a company called 1byone in the form of a LED bluetooth controller bulb that also has a bluetooth speaker built in.  I plan to integrate this with the blinkybox toy i made for my kids so that they shall be able to control the room lighting as well as the colour of the box itself.

You can get the product here Link and I've put up a short video of it in action link.  I'm going to do a full review of it soon as well as a video when it's integrated with blinky box :-)
I did have to purchase an adapter separately for it to work in a standard baynet B22 socket (UK style) but it was only 72p link

They also have a promotion on a couple of other items which would be great for a party, a smoke machine Link as well as a sound activated stage light which again would be excellent for a kids Halloween party Link.  Lastly they have a deal on iphone 6 cases link

Tuesday, 13 October 2015

Been doing some more electronics tinkering and put up an instructable of a self watering plant pot using a small 6v motor and an arduino to control it via a relay. I've put together a short YouTube video with it as well, i really need to work on my camera skills, more specifically the lighting as i think that's really affecting it. The instructable is here Let me know what you think and any suggestions would be really appreciated even if it's criticism.

Wednesday, 23 September 2015


Been bitten by the electronics bug lately and built a small lightup toy for my little ones which i've documented at Instructables for those who fancy having a go at it themselves.  I've been amassing components so plan many more builds.

Tuesday, 6 January 2015

Building your own Steam Box

Never thought i'd see the day but i have actually gotten to the point where i prefer to use a controller than the keyboard and mouse, i can only say that i must be getting old!

I've went with a Dell Optiplex 790 paired up with a KFA2 GeForce GTX 750Ti OC "Low Profile" which i have to say I've been mightily impressed with, as it didn't come with a low profile bracket i had to purchase one.  I threw in a SSD which i had lying about and it's been fantastic, it was only 128GB so I've just purchased a 512GB SSD but i'm mightily impressed with it.

I use a cheap xbox 360 wireless adaptor which i purchased from Amazon Link that works great, it's a pain to find the 64 bit drivers but once that is sorted it's just a case of firing up steam in big picture mode and your all sorted.

Monday, 30 July 2012

Plex Client on Raspberry Pi

I've got myself a Raspberry pi so i'm attempting to compile plex media center for it.  I'm doing this blog entry for personal reference more than anything but shall come back and keep things updated with what I've done so far and how successful i am.

git clone git@github.com:gewalker/plex-linux.git
cd plex-linux
git submodule init
git submodule update

sudo apt-get install automake build-essential autoconf autopoint libtool libboost1.46-all-dev libx11-dev libgl1-mesa-dev libxrender-dev portaudio19-dev libavcodec-dev libavformat-dev libswscale-dev libavdevice-dev libglew1.6-dev libmad0-dev libsamplerate-dev libogg-dev libvorbis-dev libbz2-1.0 libbz2-dev libwavpack-dev libmpeg2-4-dev libfribidi-dev libsqlite3-dev libpng-dev libpcre3-dev libcdio-dev libmysqlclient-dev libmodplug-dev libfaad-dev libflac-dev libsmbclient-dev libsdl-mixer1.2-dev libxt-dev libxtst-dev libxmu-dev libxinerama-dev libcurl4-gnutls-dev libdbus-1-dev libhal-storage-dev libhal-dev libpulse-dev libavahi-common-dev libavahi-client-dev libxrandr-dev libavcodec-dev libavformat-dev libavutil-dev libpostproc-dev libswscale-dev liba52-dev libdts-dev libfaad-dev libmpeg2-4-dev libass-dev libflac-dev libwavpack-dev python-dev gawk gperf nasm libbluetooth-dev zlib1g-dev libmms-dev libsmbclient-dev libtiff4-dev libiso9660-dev libssl-dev libmicrohttpd-dev libmodplug-dev libssh-dev libsdl-image1.2-dev cmake libmysqlclient-dev libsmbclient-dev libxrandr-dev mesa-utils liblzo2-dev libjasper-dev unzip zip


<area> http://www.raspberrypi.org/phpBB3/viewtopic.php?p=119558#p119558
<area> You should follow point 2, so that the compilation can find the GLES etc. libraries on the pi
<area> you will need to run those export commands on every new shell you open
<area> Alternatively, you should be able to add them to the end of ~/.bashrc



 in configure.in, there's a block of lines that start with dnl that mention gles
if you remove the dnl from that block, it'll understand that flag

cannot compute sizeof (size_t)
See `config.log' for more details.

sed -i -e s'/softfp/hard/g' configure.in

ac_cv_sizeof_size_t=4 ./configure

ac_cv_sizeof_size_t=4 ./configure --disable-gl

sudo apt-get install libavahi-client-dev librtmp-dev libvdpau-dev libva-dev


sudo apt-get install build-essential autoconf ccache gawk gperf mesa-utils zip unzip

sudo apt-get install autotools-dev comerr-dev dpkg-dev libalsaplayer-dev libapt-pkg-dev:armhf libasound2-dev:armhf libass-dev:armhf libatk1.0-dev libavahi-client-dev libavahi-common-dev libavcodec-dev libavformat-dev libavutil-dev libbison-dev:armhf libbluray-dev:armhf libboost1.49-dev libbz2-dev:armhf libc-dev-bin libc6-dev:armhf libcaca-dev libcairo2-dev libcdio-dev libclalsadrv-dev libcrypto++-dev libcups2-dev libcurl3-gnutls-dev libdbus-1-dev libdbus-glib-1-dev libdirectfb-dev libdrm-dev libegl1-mesa-dev libelf-dev libenca-dev libept-dev libevent-dev libexpat1-dev libflac-dev:armhf libfontconfig1-dev libfreetype6-dev libfribidi-dev libgconf2-dev libgcrypt11-dev libgdk-pixbuf2.0-dev libgl1-mesa-dev libgles2-mesa-dev libglew-dev:armhf libglewmx-dev:armhf libglib2.0-dev libglu1-mesa-dev libgnome-keyring-dev libgnutls-dev libgpg-error-dev libgtk2.0-dev libhal-dev libhunspell-dev:armhf libice-dev:armhf libicu-dev libidn11-dev libiso9660-dev libjasper-dev libjbig-dev:armhf libjconv-dev libjpeg8-dev:armhf libkrb5-dev libldap2-dev:armhf libltdl-dev:armhf liblzo2-dev libmad0-dev libmicrohttpd-dev libmodplug-dev libmp3lame-dev:armhf libmpeg2-4-dev libmysqlclient-dev libncurses5-dev libnspr4-dev libnss3-dev libogg-dev:armhf libopenal-dev:armhf libp11-kit-dev libpam0g-dev:armhf libpango1.0-dev libpcre++-dev libpcre3-dev libpixman-1-dev libpng12-dev libprotobuf-dev libpthread-stubs0-dev:armhf libpulse-dev:armhf librtmp-dev libsamplerate0-dev:armhf libsdl-image1.2-dev:armhf libsdl1.2-dev libslang2-dev:armhf libsm-dev:armhf libsmbclient-dev:armhf libspeex-dev:armhf libsqlite3-dev libssh-dev libssh2-1-dev libssl-dev libstdc++6-4.6-dev libtagcoll2-dev libtasn1-3-dev libtiff4-dev libtinfo-dev:armhf libtinyxml-dev libts-dev:armhf libudev-dev libv8-dev libva-dev:armhf libvdpau-dev:armhf libvorbis-dev:armhf libvpx-dev:armhf libwebp-dev:armhf libwibble-dev libx11-dev:armhf libx11-xcb-dev libxapian-dev libxau-dev:armhf libxcb-glx0-dev:armhf libxcb-render0-dev:armhf libxcb-shm0-dev:armhf libxcb1-dev:armhf libxcomposite-dev libxcursor-dev:armhf libxdamage-dev libxdmcp-dev:armhf libxext-dev:armhf libxfixes-dev libxft-dev libxi-dev libxinerama-dev:armhf libxml2-dev:armhf libxmu-dev:armhf libxrandr-dev libxrender-dev:armhf libxslt1-dev libxss-dev:armhf libxt-dev:armhf libxtst-dev:armhf libxxf86vm-dev libyajl-dev libzip-dev linux-libc-dev:armhf lzma-dev mesa-common-dev python-dev python2.7-dev x11proto-composite-dev x11proto-core-dev x11proto-damage-dev x11proto-dri2-dev x11proto-fixes-dev x11proto-gl-dev x11proto-input-dev x11proto-kb-dev x11proto-randr-dev x11proto-record-dev x11proto-render-dev x11proto-scrnsaver-dev x11proto-xext-dev x11proto-xf86vidmode-dev x11proto-xinerama-dev xtrans-dev zlib1g-dev:armhf
sudo apt-get clean

copied tools dir
copied  xbmc/cores dir

make -j 1

On Failing renamed /xmbc/lib/libPython/Python/build/lib.linux-armv6l-2.4
sudo make install