nD-enerserve Forums
Make changes on SmartPi's source code? - Printable Version

+- nD-enerserve Forums (https://forum.enerserve.eu)
+-- Forum: SmartPi (https://forum.enerserve.eu/forumdisplay.php?fid=1)
+--- Forum: SmartPi - English (https://forum.enerserve.eu/forumdisplay.php?fid=2)
+--- Thread: Make changes on SmartPi's source code? (/showthread.php?tid=1333)



Make changes on SmartPi's source code? - Mattanis - 20.03.2019

If I want make changes on the smartpi's open source code, how would I go forward on this? 
Do I download the open source code to the SmartPi and make the changes there with an GO IDE for RPI and then build it,
or is it easier to download the source code and make the changes with a GO IDE on a for example windows machine Big Grin  and then remotley update the SmartPi with the new code?

I hope some one can bring some light on this for me.


RE: Make changes on SmartPi's source code? - jens - 22.03.2019

The easiest way is to install a compiler on the raspberry pi. Change your source on your host and compile on the raspberry pi.


RE: Make changes on SmartPi's source code? - Mattanis - 29.03.2019

Thanks for the reply.

I have going through the code and I want to add resistance(R=U/I) of the load that I am measuring and I want like the other measurements to be saved to the DB and published on the webpage.  

I hope someone can let me know if I am missing something.  

in src directory 

readout -> main.go -> func pollSmartPi
                            -> func makeReadoutAccumulator
                            -> func makeReadout
            -> files.go -> func writeSharedFile
smartpi -> apihandlerchart.go -> func ServeChartValues
                                           -> func ServeDayValues
           -> apihandlersmomentary.go -> func ServeMomentaryValues 
           -> csv.go -> func CreateCSV
           -> database.go -> func CheckDatabase 
                                  -> type MinuteValues
                                  -> func CreateSQLDatabase
                                  -> func InsertData
                                  -> func ReadChartData
                                  -> func ReadDayData
           -> tools.go -> type ReadoutAccumulator
           -> type tXmlValue
 

I am looking at the javascript right now to see what I need to do there to get the resistance value published on the webpage. One thing I have not figured out the connection between the SmartPi go code and the JS code but something tells me that it is apihandlersmomentary.go(func ServeMomentaryValues) and js (controllers.js) but I do not know. 

I hope someone can help me and give me some directions.

Best regards 
Mathias