Finished - UDP PUSH emontx. based on mcp3xxx and esp

okay- was finally feeling well enough… and finished sorting out the UDP push for EMONTX MCP3000 and esp.
it works well just as well as a normal emontx setup . the only difference you push the full RAW data from MCP3XXX via UDP to a pi ( or computer) for higher processing…

doing this way allow me to sort through the data better and allow me to garner more information from one simple emontx/MCP3xxx/esp based device.
I am now able to see all CT output (7) at the exact same instance at a rate of <1/2 second per instance . very useful if you wish to build a load balancing application
it also allows you to display live oscilloscope display of your lines- useful in grid tie operations you can detect early warning signs of a falling GTI or other Hardware

easy to set up
load the sketch to your emton/mcp3xxx/ESP device -
after you edit it configuration to mach yours IE wifi info and the IP of the pi/computer you wish to push the data too…
on the pi/computer
set up a cron /pm2 to run this line
socat -u udp-recv:1234 PTY,link=/dev/ttyS18,group=tty,mode=770

then copy the runfiles from this zip to your bin dir
Emontx Streaming.zip (3.8 KB)
edit emontx.pl to point you voltage sensor to the correct port on your data stream and adjust your setting for ICAL VCAL PHASECAL and Crossings.

then just run emnotxstart.pl it a watch dog application. if Emontx crashes or self terminates due to stream error it will automatically restart.( for some reason after a restart of the computer the numbers are incorrect but after a simple restart of the program itself all works fine afterwards.
if you wish to view the live Oscilloscope you can use as it will display upto 9 different streams at once

Serial Oscilloscope.exe.zip (14.1 KB)
it a windows application you can use it in linux under wine you just need to configure emontx.pl and wine to point to the virtual port that the application will listen too
but there are others you just need to adjust the the output on emontx.pl to match the require format.

if you wish to MQTT you just need to add line for each output

 system(mosquitto_pub -h 192.168.168.150 -p 1883 -t /emontx -m $realPower6);

or create a json MQTT string

okay good luck have fun…

sample output
I did not have enough CTs so I point the function to point to the
out put of where one existed

1 Like