Bwired Nodejs, MQTT, Websockets Iskra Smartmeter solution

Forum about Questions, discussions and announcements regarding the Bwired website owned by Pieter Knuvers

Bwired Nodejs, MQTT, Websockets Iskra Smartmeter solution

Postby Bwired » Mon Feb 10, 2014 2:01 pm

Most of you know that i'm really a Windows guy for many years now.
I have a love hate relation with Windows but since Windows 2012 I started to dislike Windows more and more.
The step to go over to Linux started to interest me more and more with the birth of the Raspberry PI.
Also friends like Robert and Rene pushed me for years to make the turn :)
And since i got to know the Nodejs framework on Linux i had to make the switch.
And believe me; im loving every minute of it, what a relieve it is to program on Linux with Nodejs.

i have many Nodejs/MQTT/Websockets projects running now, but the first one who is presentable is the Node-js Iskra smartmeter solution.
I have a Raspberry connected to my smartmeter which sends the data via MQTT to the broker which is running on a Cubietruck http://blog.bwired.nl/?p=877
The Cubie is logging all the data to a mysql server which is also on the cubietruck and the Cubie is presenting this realtime smartmeter webpage with a realtime Graph
check out http://www.mijnsmartmeter.nl

A more detailed blog with sources can be found here http://blog.bwired.nl/?p=913
Later im panning also to open up a MQTT broker on my server so i can receive your MQTT messages as well!
Again special thanks goes out to Rene and Robert who turned me and helped me out with samples etc. during my Windows transition :)

smartmeter.jpg
Bwired smartmeter
smartmeter.jpg (180.7 KiB) Viewed 16346 times
http://www.bwired.nl Online Home, Domotica, Home Automation. Weblog. http://blog.bwired.nl
User avatar
Bwired
Administrator
Administrator
 
Posts: 5312
Joined: March 2006
Location: Netherlands

Re: Bwired Nodejs, MQTT, Websockets Iskra Smartmeter solution

Postby Digit » Mon Feb 10, 2014 3:28 pm

Well done & looking very good! :D
User avatar
Digit
Global Moderator
Global Moderator
 
Posts: 3388
Joined: March 2006
Location: Netherlands

Re: Bwired Nodejs, MQTT, Websockets Iskra Smartmeter solution

Postby Rene » Mon Feb 10, 2014 8:05 pm

[SMILING FACE WITH OPEN MOUTH AND SMILING EYES]
Rene.
User avatar
Rene
Global Moderator
Global Moderator
 
Posts: 1689
Joined: October 2008
Location: Netherlands

Re: Bwired Nodejs, MQTT, Websockets Iskra Smartmeter solution

Postby Phaeton » Mon Feb 10, 2014 8:22 pm

Looking forward to your blog !

Verstuurd vanaf mijn GT-I9300 met Tapatalk
groeten,
Harry
User avatar
Phaeton
Advanced Member
Advanced Member
 
Posts: 573
Joined: May 2010
Location: Wassenaar

Re: Bwired Nodejs, MQTT, Websockets Iskra Smartmeter solution

Postby Esteban » Tue Feb 11, 2014 7:13 am

Looks very good, I love that updating bar diagram, :)
Esteban
Forum Moderator
Forum Moderator
 
Posts: 677
Joined: January 2008
Location: Netherlands

Re: Bwired Nodejs, MQTT, Websockets Iskra Smartmeter solution

Postby Bwired » Fri Feb 14, 2014 11:05 am

check out the detailed blog
http://blog.bwired.nl/?p=913
User avatar
Bwired
Administrator
Administrator
 
Posts: 5312
Joined: March 2006
Location: Netherlands

Re: Bwired Nodejs, MQTT, Websockets Iskra Smartmeter solution

Postby Kroonen » Sat Feb 15, 2014 8:11 pm

Hi,

I'm also trying to build it.

When I run node smartmeter.,js is get an error

Any idea what it wrong?

regards Richard


Code: Select all
root@raspberrypi:~# node smartmeter.js
Starting Smart Meter
Received: /ISk5\2ME382-1003
Received:
Received: 0-0:96.1.1(4B413650303035313534323830333133)
Received: 1-0:1.8.1(00257.944*kWh)
Received: 1-0:1.8.2(00124.951*kWh)
Received: 1-0:2.8.1(00000.000*kWh)
Received: 1-0:2.8.2(00000.000*kWh)
Received: 0-0:96.14.0(0001)
Received: 1-0:1.7.0(0000.26*kW)
Received: 1-0:2.7.0(0000.00*kW)
Received: 0-0:17.0.0(0999.00*kW)
Received: 0-0:96.3.10(1)
Received: 0-0:96.13.1()
Received: 0-0:96.13.0()
Received: 0-1:24.1.0(3)
Received: 0-1:96.1.0(4730303135353631303133333035303133)
Received: 0-1:24.3.0(140215200000)(00)(60)(1)(0-1:24.2.1)(m3)
Received: (00232.296)
Received: 0-1:24.4.0(1)
Received: !

/root/smartmeter.js:158
            sendSdata(btelegram);
            ^
ReferenceError: sendSdata is not defined
    at SerialPort.<anonymous> (/root/smartmeter.js:158:13)
    at SerialPort.EventEmitter.emit (events.js:95:17)
    at /root/node_modules/serialport/parsers.js:24:17
    at Array.forEach (native)
    at Object.parser (/root/node_modules/serialport/parsers.js:23:13)
    at Object.SerialPort.options.dataCallback (/root/node_modules/serialport/serialport.js:136:15)
    at SerialPortFactory.SerialPort._emitData (/root/node_modules/serialport/serialport.js:305:20)
    at afterRead (/root/node_modules/serialport/serialport.js:283:18)
    at /root/node_modules/serialport/serialport.js:297:9
    at Object.wrapper [as oncomplete] (fs.js:454:17)
root@raspberrypi:~#
Kroonen
Member
Member
 
Posts: 302
Joined: October 2007
Location: Netherlands

Re: Bwired Nodejs, MQTT, Websockets Iskra Smartmeter solution

Postby Rene » Sat Feb 15, 2014 9:58 pm

You are calling a function sendSdata which is unknown.
Rene.
User avatar
Rene
Global Moderator
Global Moderator
 
Posts: 1689
Joined: October 2008
Location: Netherlands

Re: Bwired Nodejs, MQTT, Websockets Iskra Smartmeter solution

Postby Kroonen » Sat Feb 15, 2014 10:18 pm

I grabbed the script from the blog

http://blog.bwired.nl/?p=913

So what should it be?

regards Richard
Kroonen
Member
Member
 
Posts: 302
Joined: October 2007
Location: Netherlands

Re: Bwired Nodejs, MQTT, Websockets Iskra Smartmeter solution

Postby Digit » Sat Feb 15, 2014 10:28 pm

Drop it. I think I know where Pieter uses it for. so I assume and you won't need it.
User avatar
Digit
Global Moderator
Global Moderator
 
Posts: 3388
Joined: March 2006
Location: Netherlands

Re: Bwired Nodejs, MQTT, Websockets Iskra Smartmeter solution

Postby Kroonen » Sat Feb 15, 2014 10:51 pm

Robert,

Thats it.
Now its working , nice stuff

regards Richard
Kroonen
Member
Member
 
Posts: 302
Joined: October 2007
Location: Netherlands

Re: Bwired Nodejs, MQTT, Websockets Iskra Smartmeter solution

Postby Bwired » Sat Feb 15, 2014 11:07 pm

Hi Guys
Robert is right...as always :)

i adjusted the script on the blog also
I use this to send the data also to my old Home automation software, forgot to remove these 2 lines in the blog!

Code: Select all
var btelegram = telegram.join();
sendSdata(btelegram);


keep me posted if all is working an if i need to adjust some more
thanks Pieter
User avatar
Bwired
Administrator
Administrator
 
Posts: 5312
Joined: March 2006
Location: Netherlands

Re: Bwired Nodejs, MQTT, Websockets Iskra Smartmeter solution

Postby kylix » Sat Feb 15, 2014 11:57 pm

Hi all!

Could anybody give me a hint about modifying the code in order to get the values to be displayed from an MySQL database instead of getting them through the serial port?

Thanks
kylix
Starting Member
Starting Member
 
Posts: 2
Joined: February 2014

Re: Bwired Nodejs, MQTT, Websockets Iskra Smartmeter solution

Postby Bwired » Sun Feb 16, 2014 1:49 am

my next blog is telling how to log this to mysql via MQTT, so you have to wait :)
User avatar
Bwired
Administrator
Administrator
 
Posts: 5312
Joined: March 2006
Location: Netherlands

Re: Bwired Nodejs, MQTT, Websockets Iskra Smartmeter solution

Postby kylix » Sun Feb 16, 2014 10:18 am

I hope you're posting on the blog every day :D
kylix
Starting Member
Starting Member
 
Posts: 2
Joined: February 2014

Next

Return to Bwired Forum

Who is online

Users browsing this forum: No registered users and 1 guest

cron