Who can help me?

I have running a program that have 4 input to read the counters for consumption of water, rainwater, gas and Elec and this is working now for about 6 years without any problem. Every 30min the values are sent to a Mysql database on a Raspberry.
Sinds about 4 weeks now from time to time tere are no values send to the database. Sinds last week nothing is send to the database.
When i connect the computer to control the values via Serial monitoring then the values are written to the database. Disconnection the computer and notting works.
I have right now no idea where to search for it.
Etehernet is working because the NTP time read from the internet is correct. The sensors are working because is see the values in Serial monitor.
At the time of the Hour exact or 30min past an hour i see in Serial monitor the connection to de Mysql and the values are written to dat database.
When i disconnect the computer all stops working.
Where to search for the problem?
Thanks
Herman

Please post your sketch, using code tags when you do
Posting your code using code tags prevents parts of it being interpreted as HTML coding and makes it easier to copy for examination

In my experience the easiest way to tidy up the code and add the code tags is as follows
Start by tidying up your code by using Tools/Auto Format in the IDE to make it easier to read. Then use Edit/Copy for Forum and paste what was copied in a new reply. Code tags will have been added to the code to make it easy to read in the forum thus making it easier to provide help.

I guess knowing which board you are using is important to know.

This sounds like you're using a board with native USB. I know that Arduino Leonardo, Arduino Micro and SparkFun Pro Micro can not get rid of the data that is send to the serial monitor once you disconnect the (externally powered) board bringing the system to a near grinding halt. The same might apply to your board.

The way around that is to check if there is still space in the buffer (implemented in the Serial class) before you do the actual printing.

if(Serial.availableForWrite() > X)
{
  Serial.print(something);
}

X depends on what you are going to send (something).

How are you powering the board when it is not connected to USB? Might be a failing power supply, especially if you are relying on some type of rechargeable batteries.

You might attract more help if the title of you post gives some idea about what you want help with.

Something is different. So something changed, broke, wore out or got disconnected.

There may have been changes to elements outside of your control. Although it seems unlikely, perhaps software or firmware you did not write got updated and you will need to accommodate that.

Check your wiring, test any parts of your system that you can, in isolation, to ensure they have not outlived their usefulness or broken or become less than fully connected and powered.

If any of your stuff is exposed to the environment, it may have been changed over time and now be in need of replacement.

Stuff breaks.

a7

I am using an Arduino Mega and Ethernet Shield with W5100. This configuration worked for about 6 years. They still work when I connect a computer via USB, but when I disconnect the computer nothing works. Last night I powered the system via USB (an old cell phone power supply, 5v 1A), but this didn't help. (Is 1 amp too little?)
Nothing has changed in the code in 6 years. The fact that everything works as it has for the last 6 years when I connect a computer is that both hardware and software are in order. Perhaps the power supply does not provide enough power. The current power supply (which has been working for 6 years is 6.5v 300ma)

i'd be more willing to read thru this if the title provided a better explanation of what the "technical" problem is

1 Like

We have had a request for the code and a response from the OP without any code or further details. Looks like any further attention would be a complete waste of time.

2 Likes

the problem is gone. it was the power supply. replaced it with a new one and everything works again. was misled because i could still measure 6.5v and the leds on the arduino flickered as before.
I knew it had nothing to do with the code because it has been working without any problems for 6 years

Whether or not the code was the problem is irrelevant. You wanted help finding the issue. People here needed to know what the thing was and how it works to try to figure that out. It is really hard to troubleshoot things that you can't see and that you didn't build yourself. In those cases we ask for details to help us understand better. And if you can't be bothered to post that, then why should anyone waste any time on you?

You measured it and it was providing the voltage. What made you think to try another? What is the voltage you now measure where you had 6.5 volts with the old one?

a7

I have about 50 year experience in troubleshooting. Because everything works with a computer connected will means that everything (code) and hardware (mega and Ethernet adapter) is still working. And because the leds on the board are flikkering i was misleading. The 6.5 voltage was measured without load, but connect to te board this power supply could not delivered the nesesary power.

Try doing it without knowing what the thing is that you're troubleshooting. And with someone who doesn't want to share any information about it.

I have a device in my hand that doesn't work. If you're so good, then you tell me why my thing doesn't work.

1 Like

I'm a bit surprised that ever worked, 6.5V is a bit low for the input to the voltage regulator, but the simple plug-in power supplies generally put out more than the rated voltage unless they are loaded to the maximum current. Its possibly the capacitor was going bad in your power supply, increasing the amount of ripple and letting the voltage drop too low between cycles of the AC input - some power supplies are literally nothing more than a transformer, a couple of diodes, and a capacitor.

So I gots to wonder why you didn't find this fault immindiantly.

On my list, it would have been quite early in the alphabet.

Maybe it's my somewhat greater number of years of experience. :expressionless:

a7

Yet you came here for help, and couldn't post a simple sketch of the setup, or see a need to provide that information? Interesting. Then the answer to your question, as posed in the thread title, is "Probably, no one but you".

delta_g, what device and what are the symptoms? And yes, i'am good in troubleshooting what will not say i can always repair it. But most of the time i can give you a very good indication where the problem can be.

When faced with "it worked, now it does not work" I look for "what has changed?" or better "what changes?" The code could only change with intervention. The connections could change by chemistry. Power changes at any act of nature (humans are included), and links your code to the transmission medium and eventually the database.

Try not to look for fingerprints of old, but logical order of operation.

Im sure the code is ok. I wired it properly. Why doesn't it work?

You're the great troubleshooter. Please tell me.