Reading Init file wirelessly

Hello,

I am developing a second prototype for a solar cattle feeder controlled by Arduino.

The first one is running nice since one year, the only problem has been corrosion due to environmental condition.

In the second prototype I want to avoid any external devices or connectors, so I cannot read from USB or have a Keypad.

My question is: How to read about 10 to 16 integers which are needed to initialize the program ?

After reading the forum, I think the best way is to install a HC5 or similar BTooth device, and read the Init Data while executing Setup() function from an external telephone that will have the .txt file holding the Init data.

I am well oriented, or is it an easier way ?

Thanks a lot,
Horacio

HARRIS46:
My question is: How to read about 10 to 16 integers which are needed to initialize the program ?

When, and how often does this need to happen?

Do the values change?

...R

Hello,

Thanks for your help,

The integers that controls the number of daily feeds, the hour of each feed, and the volume to be served, only change with season changes, and when the number of cattle to feed changes.

Tipically, once a month.

What I do today is to remove the controller from the autofeeder body
Bring it at office (in the same farm)
Connect it to Computer,
Change parameters programatically,
Upload
Reinstall

Thanks again !
Horacio

HARRIS46:
Hello,

Thanks for your help,

The integers that controls the number of daily feeds, the hour of each feed, and the volume to be served, only change with season changes, and when the number of cattle to feed changes.

Tipically, once a month.

What I do today is to remove the controller from the autofeeder body
Bring it at office (in the same farm)
Connect it to Computer,
Change parameters programatically,
Upload
Reinstall

Thanks again !
Horacio

How about an SD card. Store the numbers you need in EEPROM and have a routine in your code where you can pop in an SD card and hit a button and it will read them from a file and update in the EEPROM. Pop the SD card out and take it to the next unit. You don’t even have to restart the code then.

I would take a completely different approach.
Let me give you an example.
I set up some LED controllers in a weatherproof box outside this past winter for our Christmas display. I was not going to go through the snow to pull the processor and bring it back in for any program changes.
So, my solution was to use Wemos D1 Mini boards. I added the OTA and MQTT Pub-Sub libraries. With OTA, I can reprogram the Wemos wirelessly, and with MQTT, I could send commands to change the patterns, but I never used it in this last year's project. Using MQTT, you could easily send interger values to the controller, and if you have any sensors in the project, get the readings back.

Thank you very much for both answers,

SD Card: I have considered use an SD card, but in that case I need an external slot to plug the SD card.
That slot will be prone to corrosion. Same for an external keypad, or USB slot.
Perhaps there are industrial grade slots that can decently do the job, I don't know.

Wemos D1 Mini boards:

First time I read about. I will google and study it. It allows a complete closed box, that is a good point, as you showed in your picture.
Is a microcontroller that does all the work, in that case I don't need an Arduino,
Or is an add on to Arduino that gives wifi connectivity to the ATMega?

In both cases, I know how to write a complete Structure to and read from EEPROM. Once the Struc is defined, just a put to update init values, and one get to read them.

That is the easy part, but still... how to write externally (no wires) that EEPROM?

Thanks again,
Have a nice evening,
Horacio

Why an external EEPROM? Use the one on the Arduino. How much data do you need to store?

HARRIS46:
Wemos D1 Mini boards:

First time I read about. I will google and study it. It allows a complete closed box, that is a good point, as you showed in your picture.
Is a microcontroller that does all the work, in that case I don't need an Arduino,
Or is an add on to Arduino that gives wifi connectivity to the ATMega?

The Wemos D1 Mini is my go-to processor for most of my projects. You program it with the Arduino IDE, it has more RAM than the Uno (4mb), WiFi, and a fraction of the cost. What's not to love?

I have only needed an Arduino board once because the shield I needed only worked with the Uno. Another was a project using the Nextion display that needed two hardware serial ports.

Another option with a regular Arduino would be to equip it with an nRF24L01+ wireless transceiver and have another master Arduino (also with nRF24) that is used occasionally to send new data. When the Arduino receives new data it stores it in its EEPROM memory.

If there is mains power for the active units I would just have them listening for wireless data all the time even though most of the time nothing is sent.

If the active units are battery powered and must be extremely economical in their use of energy then there are other strategies that could be used - but it depends on how you want to interact with the system. For instance would it be OK for the wireless only to be listening during a particular hour of the day?

An advantage of using the nRF24s is that the programming should be much simpler if you don't already know web programming.

...R
Simple nRF24L01+ Tutorial

Hello,

Thanks all the views !

Comments:

Delta, I did not refer to an external EEPROM, just how to write the Arduino EEPROM from outside the box.

Steve: I will study the new microcontroller, and perhaps follow your way, but…

What’s not to love?

Two things: Curve of learning, and most important, I live at 420 Km of Buenos Aires, and getting new hard is nor easy in lockdown.

Robin2: The energy point you guessed is a limitation. Even my LCD dicplay is powered on demand, to avoid draining batteries all day long. Thanks for the time activation tip.

Last one:

What do you think about this one: put a BT module (HC05) and read via setup() a file from a paired cell phone, then load the file contents to a Struc and update the Struc to EEPROM ?

I appreciate very much your help !

Have a nice day,
Horacio

HARRIS46:
Robin2: The energy point you guessed is a limitation. Even my LCD dicplay is powered on demand, to avoid draining batteries all day long. Thanks for the time activation tip.

That was only one very vague suggestion. To design a practical energy saving approach it is necessary to have more details of how and when the system is used.

For example maybe it would be convenient to have an active wireless period at the same time as some other actions. There are dozens of options.

...R

Instead of time activation of the wireless I'd add a push button (you can find them waterproofed easily). When you walk up to your unit you press the button to activate the display, that could start the WiFi as well. Or if you often check the display but not the WiFi use a second button for the WiFi, activating it for a few minutes or until you're finished with your upload (should take seconds).

Time activation wastes power as often you're not there, and if you miss the time slot you have another problem...

Hope you have enough pins for all that as the WeMOS has only 11 I/O available, two of which are connected to the USB for Serial comms.

wvmarle:
Instead of time activation of the wireless I'd add a push button (you can find them waterproofed easily).

That's a good idea if it is otherwise suitable. I had not realized the OP would be that close to the units.

...R