we struggle with the following situation. We would like the relays to start in an ‘on’ state after a reboot. If need be, I am willing to modify the source code (available on github) to achieve this goal, unfortunately I have been unable to locate any build instructions so far.
In MPLAB X open the Loadables folder.
And rightclick on ETH_Btl_ETH_Starterkit and hit remove.
After that rightclick on the Loadables folder and select “Add Loadable File”
Then select the file you’ve previously downloaded.
Great! Thanks for the help, and the clear instructions. The situation has improved (a lot :-)), but I still seem to be missing a .h file (plib.h). Where can I find this one?
edit: I found a plib.h under the lega-c directory, but it is filled with references to other header files that are also not found (and most I can’t seem to find anywhere else)
pulls hair out this is an extremely frustrating (and slow) process.
I managed to download the libraries, but now I obviously need to somehow convince MPLabs to look into the correct folders to find this(these) file(s). I don’t have much experience with the MPlab IDE and I have tried adding a path to the 1.40 folders in the project settings, but this has then led to MPLab not finding base c includes anymore. Adding more folders to the settings created new and strange warnings and errors.
Could anyone please explain how I can get this code to compile and output a useful hex file. If need be I will start over from scratch.
EDIT: I’ve checked and I know now why I didn’t implement the feature. I write the settings to an external Flash IC. The IC has an endurance of 100,000 write cycles. If I say write every second to the flash it would only last just over a day.
I can implement it, but the card would be broken in a few days.
I must be dense, but I don’t understand what you mean. Even if you were to restart the relay in the state they were at shutdown, this would only require recording their state at reception of an instruction to change their state. But even that is not required: all we want is that the relays start in an ON (closed) state after a powercycle (independent of what state they were in at the time of shutdown), I fail to see how this affects writing to an EEPROM.
To clarify, we use the VM204 to powercycle devices in remote locations when these devices crash (which does not happen very often, or when they reauire a powercycle to update their firmware). The problem with the situation as it is now is that after the site suffers a blackout (which happens every now and then), the devices fail to reboot automatically (since the VM204 defaults to a relays off state), until we send commands to the VM204 to turn the relays back on.
The changes required to the firmware are thus quite limited, but I need to be able to compile a valid hex-file, which I so far have completely failed to do.