Processing + OSC + Arduino: Application Freezes When Controlling Fan

Hi There, I was wondering if anyone could help me. I am trying to drive a fan/motor using an OSC command. It’s running well through via an arduino to a potentiometer controller on the fan. I have used OSC as the button push which triggers the fan also needs to trigger other actions. It sometimes works well, but sometimes the application ‘hangs’. This can be after a couple of hours of running or sometimes after 5 minutes of running.

I generally have to power cycle the arduino and computer to get the processing application to function correctly again.

Hello @brightscape,

Have you tested the setup with the fan disconnected?
Electrical noise or power fluctuations from the fan can interfere with the microcontroller and cause communication problems.

The guidelines here are helpful:
Welcome to the Processing Foundation Discourse

:)

Thank you glv for your response.

I have a counter on the application and it ran for 42,039 seconds from the most recent button press before it started to hang.

I will try with the fan disconnected. If this is the problem is there any workaround?

Thanks again,

Brian

There are best practices for control systems and isolation of what you are controlling.
If you turn stuff on and off and it resets Arduino you will know.

Try and generate a minimal example that reproduces the problem.

Details help to resolve issues in systems like this.

OS?
Processing version?
OSC library?
Are working over WiFi?
Using serial?

What do you observe when it hangs?
Anything in the Processing console to share?

:)

Again, thank you for your time.

I will look into the control systems and isolation best practice.

OSX 15.7.2

Processing 4.4.10

I changed the OSC out for a Midi library, but I’m still having the same issue.

It’s not working over WIFI, it is using serial although the macmini is connected to WIFI.

When it hangs, it just freezes, it doesn’t respond to the midi or osc. The app won’t quit or force quit after it hangs so I need to power cycle both the machine and the fan to get it to work successfully.

Much appreciated!

I can’t see anything on the console as it is running on the standalone app right now.

Next time it crashes I will run it through processing and see if there is anything of note on the console.

Hi,

These can be difficult to diagnose remotely (me being remote):

Serial communications can be a challenge as well and cause issues.

Check the console folder for logs in the same folder as preferences.txt (down at bottom):

It logs the console output to the best of my knowledge.

Keep at it!

:)

Hi @brightscape Is this still a problem? Please say what type of Arduino you have?