A Forum run by Enthusiasts of MidNite Solar

The Open Source software/hardware corner => Raspberry PI => Topic started by: TeslasPigeons on June 30, 2015, 06:52:17 PM

Title: Using newmodbus on RPi Questions
Post by: TeslasPigeons on June 30, 2015, 06:52:17 PM
Hello all - 

I'm very interested in using the newmodbus as designed by RossW (I believe).  I have found the installation instructions as written on the wiki page for the blackboxproject.  My question is, is it necessary to do the full LAMP stack install if I just want to export the data to a text file locally on my RPi?  Ideally I'd like to grab the data being dumped by my classic 150 and place it in a text file and then use python or shell scripting to manipulate it a bit before FTPing to my own personal server.  Is that possible?  Thank you for any help you guys can offer me, I have spent the day trying to figure it out by reading through the forums before starting a new thread.
Title: Re: Using newmodbus on RPi Questions
Post by: dgd on June 30, 2015, 08:00:52 PM
When I last tried newmodbus (a long time ago) it was executable from a shell prompt. So if you are not using the LAMPs components such as Mysql, Apache and PHP  then there is no needs to load those lamps components or the complete LAMPS stack.
You could just write a cron'd shell script or a small C program/python program,  use a system call to execute newmodbus and redirect its output to a file or whatever.

dgd
Title: Re: Using newmodbus on RPi Questions
Post by: RossW on July 01, 2015, 07:24:33 AM
Absolutely... and that's all I do too.

Executable, no other bits loaded or required. No modbus library, nothing.
newmodbus can in fact write to a local file without needing to redirect the output, although in a unix environment it makes little difference.