Looking to hire someone to "connect the dots"

Hello!

I have a web page that will act as a "control panel" served up on a raspberry pi3 for a machine that is being developed. I also have arduino code that will control the machine. Both of these on their own work fine. What I'm looking for is for someone who can connect the two together in communications (via WiFi). Here is what I need in particular:

  • When the user clicks or presses a button on the control panel, that signal needs to be sent to the arduino so the action can take place. I'm looking for someone to make this happen or show me how to make it happen.

  • The arduino will have "readings" that will need to be sent to the web page/contol screen. These readings will need to update continuously without reloading the page. I'm looking for someone to make this happen or show me how to make it happen.

  • There will be several numbers from the arduino that will need to be saved and then later recalled when necessary. I'm looking for someone to create a database and have the arduino or raspberry pi read and write to it in order to save and recall these particular numbers (or show me how to do it). I will storage room on the raspberry pi and/or I can put an SD card on the arduino to accommodate the database.

EDIT: I forgot to mention this, but this project will not have internet access. It will all be working on it's own network provided by (more than likely) an ESP32/8266 module.

I have researched for weeks and read/followed countless tutorials and haven't found any that fit my particular project. If anyone is interested, please let me know.

Thank you!
Ron.

Machine and wireless is a great risk. What do the machine if the connection fails?

If you place the webpage on the machine site, you can use websockets to communicate.

MQTT is another possibility.

Storing in a database is possible due the arduino/ESP that sends the needed values with sql statement to an database.

On RPi you can use MariaDb to make a database.

buckfast_beekeeper,

I appreciate the advise. One thing I guess I forgot to mention is that this will not have any web connection. The whole thing will be on it's own network, either set up on the RPi or (more than likely) on an ESP32/ESP8266 module.

I have heard of and read on all of this information, but it's way beyond me at this point and I need to show that it can be done in an upcoming demonstration in early January. I don't need to have the whole thing working, but I do need to have at least one aspect of it working.

Thank you,
Ron.

Usually, putting multiple computers in the mix makes things harder. Is there any reason the Pi can't serve up the web page and control the machine?

wildbill,

I appreciate the response. The web page is actually being served up on the RPi. Unfortunately, the Pi is really difficult to program compared to an Arduino (at least for me). Also, I will actually be having two arduinos working different controls (mostly motors) in different parts of the machine. My intention is to have the Arduinos and Pi communicate with each other sending data and commands back and forth depending on user input on the web page.

Thank you,
Ron.

What will the 'machine' do?

What if @ example a stop command don't reaches the 'machine'? And that have nothing to do with outside connections. Intern can there go something wrong. For a 'machine' you must go out from worst case scenario's. What is the machine doing @ auto reboot? That a light miss the go out or go on is in most cases not a problem. That a CNC machine miss the stop or lift commando is in most cases not allowed.

Don't you have a machine directive? That say how a safe machine must be made. All that have motion, heat, ... must made that there isn't a possibility to injure the user or the visitor.

buckfast_beekeeper,

I appreciate your concern, but we have all of that covered. I'm just looking to find out how to get the data from the Arduinos to the web page and get the commands/signals from the web page to the Arduinos. That's the part I'm having trouble with.

Thank you,
Ron.

MQTT has already been mentioned - you can run a broker on the Pi. It's nice in that you can test by making and consuming entries without having to have everything working.

@jsmwrench
I suggest that you ask that interested parties contact you by 'DM'.

Yes, in fact, I've already installed it on the Pi. I just don't understand how to use it... with the Pi or the Arduinos, which is one of the reasons for needing someone to show me/ do it.

This sounds like something the sales department cooked up without any technical experience and now has to show it off to management. The proper path now would be to let the engineering department solve the problem of getting the system to do the job it was designed for. Coming to a hobby forum for advice at the last minute is poor planning.

MQTT is your best bet.

I know little about keeping a web page refreshed. Make that nothing. But I see it all the time, so let me do some research.

The Pi, being an OS itself, would be best for keeping a database.

This is a red flag to me. Especially that you need a demo by January!
For whom is it being developed? A technician? Grandma? Does it have to be idiot proof so that a manager can run it?

Exactly what does the Arduino do? If it just controls relays, then why isn't the Raspberry doing everything?

In my house, I run everything on Home Assistant. HA can run on the Raspberry Pi (though I am using an Intel NUC for mine). The UI is a web page and I can turn on/off any of the lights and some appliances. Some of the target devices use the Wemos D1 Mini board because it runs Arduino code and it has WiFi. The Uno doesn't. (And it only costs $5).

SteveMann,

I appreciate your response. I was really trying to avoid writing a novel about how I got to where I'm at, but it seems that it must be important so I'll try to explain it in as short of a story as I can.

About a year ago, my friend (I'll just call him Jim to make it simple) was telling me he invented a way of doing something that would be "revolutionary" to the field he is in. (I can't go into details due to him still trying to get a patent.) Anyway, he asked me if I knew anyone that could give him a way of controlling a stepper motor with a joystick. He had a bunch of parameters to go along with the request, but those aren't important right now. As a hobby, I have been learning to do things with Arduinos and ESP32/8266 microcontrollers and told him I could do it for him.

I had never done anything with stepper motors, but knew there were tutorials abound and eventually I got it working the way he wanted. As a few months went by, I began to learn more about what he was doing and asked him why he doesn't give the user an interface like a touch screen to control the different aspects of the machine. He thought it was a fantastic idea and asked if I would be willing to learn how to do this. Of course, I jumped at the chance because I love working with arduinos and thought this would be a great opportunity to add to my skills.

This was going well. I made the web page interface, learned how to get it on a raspberry pi, and how to serve it up in kiosk mode. I then started doing research on how to transfer the data from the controllers to the web page on the Pi and the command signals from the web page to the controllers. That's when I found out it was very convoluted with numerous ways of doing. I didn't know which way would be the most efficient for my project and which ever way I choose, I would have to learn it from scratch.

That brings us up to about a month ago. Even though Jim wasn't intending on "doing" anything with it until it was complete, a potential business proposal came his way that he couldn't ignore. In fact the "client" thought the idea was so good he told Jim that if he could provide proof of concept in January, he had a solid offer for him.

I've tried for a few weeks now to come up with something and I've even made several attempts that ended up getting thrown out half way through them. It's a bit too over-whelming for me in this short amount of time to learn what I need to in order to accomplish this goal.

I only need to get one aspect working to show proof of concept. The control screen is already done and if I can make it so Jim can at least use one feature on the control screen and get the machine to follow the command, then the client will be happy. The rest of the code and development can be done afterward.

So, making a short story longer, what I basically need to do be able to push a button on the control screen to make a stepper motor move 100 steps in one direction and press another button to make it move 100 steps in the opposite direction. I also need to be able to display the step count (which is being tracked with the micro-controller) on the web page. Might sound simple to you all, but nearly impossible for me.

Use an ESP32 board. It has WiFi on it and you can do everything from one board. No need to communicate between an Arduino and a Raspberry.

I would start with putting the web server on the ESP32, then add the control code.

Wait, what? Web page? Why? Do you plan to control the machine from other locations? Why not just use a Nextion touch screen on the ESP32? What display is the Raspberry using?

Sounds to me that you are overthinking this. That's usually my job.

LOL! I definitely could be.

I have a 10.1 color touch screen by Elecrow.

Can the ESP32 display something like a control panel in "kiosk" mode (where there isn't any browser bar or menus?

No, because the Elecrow is an HDMI/VGA device and the ESP32 doesn't have HDMI. Nextion makes a 10.1 inch touch screen. It's been a few years since I used a Nextion display, but your description sounds pretty simple. The Nextion communicates with the ESP over a Serial connection (Tx/Rx).

I'll have to stick to the RPi, then. For future expandability, Jim wanted to be able to offer the option of connecting a larger monitor to it if the client needed/wanted to. He also wanted to be able to use a mouse if desired and the RPi has that option with the USB ports.

Don't get stuck in the weeds of making the perfect proof of concept. You already have the two parts working, so the most expedient path to the POC is to move the Arduino code to a Wemos D1 Mini or an ESP32 board since they already have WiFi. Then simply use MQTT to send commands/data between the two.

I'll give it a shot. Thank you.

But MQTT needs a MQTT server (on RPi?). It is a step extra what can be done by the ESP only.

With websockets all can in one ESP32 (ESP8266 has little pins and low RAM). Every time there is an update, send a socket to the webpage. Every button change on the web page send a socket to the ESP.

Every second time update from an ESP8266. From the webbrowser side.