(SOLVED) Problem creating new emoncms module

Hi  apologies for being a novice programmer!

I have been trying to follow Trystan's tutorial on creating a new module for emoncms but have fallen at the first hurdle!

My setup is RPi with HDD EmonTx2 with relay card & EmonTx2 for power logging

emoncms on the Pi is uptodate!

on trying to view "myelectric" I get the error message:

Parse error: syntax error, unexpected 'Â Â defined' (T_STRING) in /var/www/emoncms/Modules/myelectric/myelectric_controller.php on line 4

The code I entered into myelectric_controller.php was copied & pasted from

https://github.com/emoncms/development/blob/master/Modules/myelectric_tu...

I have looked at other _controller.php files in the other modules but I cant spot the error!

I downloaded the "My Heating" module and that seems to work OK

I'm sure its something simple, probably obvious to most! Is it something to do with copying & pasting code?

I am creating & editing the files on the Pi using the startx gui

On another note, if an emontx is set up as a heating controller with a relay board can you use packet gen to send it variables (such as temperatures) that are being logged onto emoncms from say an emonth? or can you set up control programs on emoncms to control heating systems? - presumably these could be more sophisticated than arduino sketches.

Regards

Richard

TrystanLea's picture

Re: (SOLVED) Problem creating new emoncms module

Fantastic! great to hear your trying the tutorial, it must be a copy and paste error, I've just tested copying and pasting here and it worked. You could try commenting out line 4 if that doesnt work to isolate the point at which the error disappears, always a good tactic.

On the heating control question, it may be better to send the emonTH reading directly to the emonTx and miss out the via emoncms stage and so reduce the possible points of failure. Your PI can go down but the heating will still adjust to emonTH temperature. But yes developing sophisticated control interfaces in emoncms would be good too, for doing things like creating a heating schedule.

hatfieldr's picture

Re: (SOLVED) Problem creating new emoncms module

re-entered code by hand & it worked fine!

Why does copy & paste do that?

 

Richard

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.