Author Topic: How to design hardware to connect with a Web Server ( With Ethernet)  (Read 1818 times)

0 Members and 1 Guest are viewing this topic.

Offline RigolonTopic starter

  • Regular Contributor
  • *
  • Posts: 70
  • Country: 00
Hey guys,

I may have a chance to work on a project to design a product for a company. The equipment is suppose to control velocity and direction of a motor. Can't really discuss more than that. It's pretty simple do that and I know I can do this with ease.

But here is the catch, this company sells the machine that has this motor across the nation and they want to control this from the internet. And that's what I don't have any idea on how to do. So from the web I would choose the device I want to connect to and increase/decrease velocity for example.

I know that I will need a web server and found a lot of material on how to build one, but I have no idea on what I will need to do with the hardware and how to configure it to connect with the web server. I'm having trouble on how to search on the web, so this is what I want help with.
Any links or terms that I can use to search for references?

Some dude suggested that I use the module usr-tcp232-t2, for now I have the Ethernet Shield for arduino to start learning.
Are there any other module you guys suggest?

PS.: The company asked for the connection be by ethernet and not Wi-Fi
 

Offline rstofer

  • Super Contributor
  • ***
  • Posts: 9964
  • Country: us
Re: How to design hardware to connect with a Web Server ( With Ethernet)
« Reply #1 on: December 05, 2019, 04:40:35 pm »
There are many embedded web server projects on the Internet.  A minimalist server is coded on each client machine.

Search for 'embedded web server'

https://www.allaboutcircuits.com/projects/using-an-arduino-as-a-web-server/

Even Arduinos can do it!

I would use an mbed compatible LPC1768 board because the only thing you need to add to the hardware is a MagJack to get wired ethernet.
https://www.mbed.com/en/

https://os.mbed.com/platforms/mbed-LPC1768/

There are dozens, if not hundreds, of platforms that can do this kind of thing.
« Last Edit: December 05, 2019, 04:43:20 pm by rstofer »
 
The following users thanked this post: Rigolon

Offline stoyanoff

  • Contributor
  • Posts: 34
  • Country: bg
Re: How to design hardware to connect with a Web Server ( With Ethernet)
« Reply #2 on: December 05, 2019, 07:58:14 pm »
Are you sure you want an expansion module? You can just use an interface iC + RJ-45 shielded connector?! It is cheeper, you will have controll over the quality of the RJ-45 connector(this could be important in some ways) and you will have control over the TCPIP stack and how your system is going to work...
Best regards!
 

Offline rstofer

  • Super Contributor
  • ***
  • Posts: 9964
  • Country: us
Re: How to design hardware to connect with a Web Server ( With Ethernet)
« Reply #3 on: December 05, 2019, 08:56:22 pm »
This project is a lot like the millions of IoT projects and MOST of them are gigantic security leaks.  You have an unprotected web port open to the universe with no real control over what happens to it.  You might research IoT security.  If the mothership can contact the web server, so can the kid living in his grandmother's basement.

I think I would spend more time worrying about security and less time worrying about the application.  I don't know if SSH has been implemented on a low end uC and this alone might drive the project toward a Raspberry Pi and Linux.  Since, presumably, there are a very limited number of authorized users who can contact the widget over the Ethernet, it might be worth developing a custom application for the users and using a very secure link.

An open Port 80 will be discovered in minutes.  Use a firewall like SmoothWall and see how often your router gets hammered.

in the end, no matter what you do, somebody is going to break through your security.  It may take minutes, it may take an hour but it won't take more than that.  If what can be done over the Internet can result in a safety hazard, I would run away from this project as fast as my feet could take me.  Somebody is going to get the blame when a user gets injured and liability insurance almost certainly woudn't cover the damages.
 
The following users thanked this post: I wanted a rude username

Offline capt bullshot

  • Super Contributor
  • ***
  • Posts: 3033
  • Country: de
    • Mostly useless stuff, but nice to have: wunderkis.de
Re: How to design hardware to connect with a Web Server ( With Ethernet)
« Reply #4 on: December 05, 2019, 09:13:36 pm »
If you don't know how to make a web server on a MCU or arduino, I'd recommend to use e.g. a Raspberry Pi board to set up the web server, this would allow to use all the common knowledge and tools to do so and doesn't require hardware design. Then you'd have to find a way to connect the Raspi to your motor controller and issuing commands to the motor controller. One of the simplest ways to do would be to use a serial port, or some GPIOs.
Safety devices hinder evolution
 

Offline ToniGodoy

  • Contributor
  • Posts: 11
  • Country: es
Re: How to design hardware to connect with a Web Server ( With Ethernet)
« Reply #5 on: December 05, 2019, 09:41:27 pm »
I'm with rstofer.

I'm a very rookie in electronics but an old engineer of networking and security systems.
All clients have dreams about science and want to implant science fiction systems in their organizations. Be very careful! You are the one responsible for setting their feet on the ground and you will be the one responsible for any damage suffered by the company due to your design.

My advise is to have an external web server, a laptop or a computer, for doing all the work a web server must do (firewall, web server, user access control, and everything else) and then to design an interface (it may be ethernet, of course) for the motor to receive/send control and data packets to the web server.
Another very different thing is when the web server is meant to connect the system to a single computer or to an internal network.

Note:
I have been the designer and the only responsible for building such systems in the past. Linacs which could kill a patient if any intrusion happened and I don't have enough words to prevent you of taking such jobs without taking all precautions you can.
« Last Edit: December 05, 2019, 09:52:03 pm by ToniGodoy »
 

Offline rstofer

  • Super Contributor
  • ***
  • Posts: 9964
  • Country: us
Re: How to design hardware to connect with a Web Server ( With Ethernet)
« Reply #6 on: December 05, 2019, 10:21:42 pm »
Another very different thing is when the web server is meant to connect the system to a single computer or to an internal network.

The 'internal network' idea works right up until some manager simply MUST dual-home his PC because he is so very important.  Somebody, somewhere, will bridge the internal and external network.

I installed the infrastructure for a rather large company (I worked for them) and the network was said to be 'internal' at that point in time EXCEPT for a unknown link that went to another site and their network connected to the Internet.  There were a lot of frowns when I pointed out that I could get to the Internet despite their assurances.  It wasn't supposed to happen!  It was discussed endlessly in meetings.  It took about 5 minutes to pop their balloon.

There's a lot of work on securing IoT projects and I'm not up to speed on the latest techniques.  And that's the point!  If the OP doesn't already know how to embed a web server, chances are he isn't up to speed on this stuff either.

They couldn't pay me enough to do this job.  Of course, being retired for 16 years means nobody has tested my determination to never work again!
 

Offline KE5FX

  • Super Contributor
  • ***
  • Posts: 2096
  • Country: us
    • KE5FX.COM
Re: How to design hardware to connect with a Web Server ( With Ethernet)
« Reply #7 on: December 05, 2019, 11:16:53 pm »
You probably want an embeddable server module like these.

As others have said, don't try to homebrew something from scratch if you're not already highly experienced at this stuff. 
 

Offline ToniGodoy

  • Contributor
  • Posts: 11
  • Country: es
Re: How to design hardware to connect with a Web Server ( With Ethernet)
« Reply #8 on: December 05, 2019, 11:40:38 pm »
@rstofer:
Lots of anecdotes like yours. Some ones funny and some ones very unpleasant.

The point here is that in our former jobs you were just one step from going to jail if you are not very very cautious and don't know very well which clients you choose . On the other hand, he could build the circuit and let all the networking and programming stuff to his client's company. That's what most of the manufacturers do. This doesn't free you of all the responsibilities though, but might be a good balance.
 

Offline pcmad

  • Regular Contributor
  • *
  • Posts: 98
  • Country: gb
    • module web design
Re: How to design hardware to connect with a Web Server ( With Ethernet)
« Reply #9 on: December 05, 2019, 11:45:33 pm »
why ot use a rpi as its based o liux and over 90% of webservers use linux  so you wont have to worry about scuritty as much as you ca do updates

Offline ToniGodoy

  • Contributor
  • Posts: 11
  • Country: es
Re: How to design hardware to connect with a Web Server ( With Ethernet)
« Reply #10 on: December 06, 2019, 12:14:43 am »
@pcmad:
All that servers you are talking about cost only a penny when compared with all the security stuff that surround them.
 

Online forrestc

  • Supporter
  • ****
  • Posts: 720
  • Country: us
Re: How to design hardware to connect with a Web Server ( With Ethernet)
« Reply #11 on: December 06, 2019, 12:39:07 am »
But here is the catch, this company sells the machine that has this motor across the nation and they want to control this from the internet. And that's what I don't have any idea on how to do. So from the web I would choose the device I want to connect to and increase/decrease velocity for example.

The protocol you're going to want to use is likely MQTT.    MQTT pretty much is available on any modern ethernet-connected microcontroller.   For example, Microchip Technologies has MQTT support in both their MCC (8/16 bit) and Harmony (32 bit) library stacks.    In general what you do is configure some certificates on your device to uniquely identify it (often using an encryption coprocessor to store the keys), and then provision a MQTT server somewhere on the internet with those MQTT keys.   After that is done, you can send messages between the server and the end device.   Often MQTT is implemented in a way which both the server and the end device have a set of shared variables and messages are sent between the devices to keep both ends synchronized.   

Tools from microchip in the lower-end processor space:

https://www.microchip.com/developmenttools/ProductDetails/AC164164
https://www.microchip.com/DevelopmentTools/ProductDetails/AC164160
(and others are available).


You're going to need to come up with someone on your team which understands how to do the web server piece.   If I was doing this part I'd set up a serverless infrastructure using AWS-IoT or Google IoT which all of the devices connect to.  Then you'd need to write the web server piece that interoperates with this.    A good web developer should be able to knock this out fairly quickly, possibly something one could contract out.



 

Offline pcmad

  • Regular Contributor
  • *
  • Posts: 98
  • Country: gb
    • module web design
Re: How to design hardware to connect with a Web Server ( With Ethernet)
« Reply #12 on: December 06, 2019, 02:04:00 am »


@pcmad:
All that servers you are talking about cost only a penny when compared with all the security stuff that surround them.

when looking at security on the linux box its self needs to be configured with security regardless of the other securty stuff surround them

my linux server has that  security stuff that surround them how ever i still secure my server on the box as ever day i get 1000s of bots trying to find away in

this is why IoT suff has bad security becouse no one considors this and thats why its a bigg issue with IoT

Offline rstofer

  • Super Contributor
  • ***
  • Posts: 9964
  • Country: us
Re: How to design hardware to connect with a Web Server ( With Ethernet)
« Reply #13 on: December 06, 2019, 04:05:00 pm »
It might be worth taking a look at OpenBSD - secure by design.  It might be thought that there are too many hands messing with Linux.
 

Offline ToniGodoy

  • Contributor
  • Posts: 11
  • Country: es
Re: How to design hardware to connect with a Web Server ( With Ethernet)
« Reply #14 on: December 06, 2019, 04:34:00 pm »
In my opinion, forrestc's advise is the best you can follow.
I would resume it as follow:

1.- You build the hardware for the motors (call it device or publisher) to connect to the server (broker). You do this by means of the tools forrestc pointed above. Yo can do it using the protocols pathway: YourDevice->MQTT->TCP->IP->Ethernet-> toward a router. At the TCP layer you use a pair of certificates from a good known authority.

2.- You don't build the server infrastructure but use a well known one like Google or AWT IoT cloud.

3.- You or someone else deal with the software for sending/receiving/consulting the control/data toward/from your device and the broker (server) plus the GUI interface, both in the servers of the chosen IoT cloud.

4.- Your client connects to the IoT cloud to control or analyze the data by means of the GUI you built (for example a web app in the IoT cloud's server) and the lots of analysis tools the IoT cloud brings to you. Of course, this connection from the client must be secured by another pair of certificates.

We didn't have all these tools and infrastructures before and we had to build them for private use using VPNs or private links but it seems to be the correct way nowadays.

Cheers to forrestc. He made the good point.
 

Offline RigolonTopic starter

  • Regular Contributor
  • *
  • Posts: 70
  • Country: 00
Re: How to design hardware to connect with a Web Server ( With Ethernet)
« Reply #15 on: December 06, 2019, 05:32:16 pm »
Well first of all, Thank you all for the help and tips.

Thx to you guys I found a lot of material do study. The company is actually trying to create a team to develop this system, so I'm taking part on the selective process and I need to show them that I at least have some ideas on how to solve the problem. They didn't say when the project must be finished yet, next stage of the selective process is next week (12/12). Is down to 17 candidates and they will hire at least 4.
I will let you guys know how is it going.

About the security part, I was also worried about that, but my main concern first is to learn a little how to create the application.  Since I can't protect something that doesn't even exists.

But again, thank you all, and I will take it to heart what you all said about security concerns.
 

Offline ToniGodoy

  • Contributor
  • Posts: 11
  • Country: es
Re: How to design hardware to connect with a Web Server ( With Ethernet)
« Reply #16 on: December 07, 2019, 12:46:22 am »
I wish you Good luck.
 

Offline RigolonTopic starter

  • Regular Contributor
  • *
  • Posts: 70
  • Country: 00
Re: How to design hardware to connect with a Web Server ( With Ethernet)
« Reply #17 on: December 12, 2019, 04:53:42 pm »
Update:
Didn't get the gig  :(. Thx for all who wished me luck.

But I'm learning a lot of interisting stuff. Found some tutorial by Wilfred Nilsen (RealTimeLogic) and will continue on this path.
Also found a nice tutorial to create a webserver on an arduino which sends a SMS when moisture of the soil is too low. Will adapt it for some other use, but now I have a start point.

For those who might find useful here is the link:
https://dzone.com/articles/arduino-esp8266-iot-light-controller
https://realtimelogic.com/products/simplemq/
https://dzone.com/articles/building-an-iot-system-using-arduino-and-iot-cloud


 

Offline jmelson

  • Super Contributor
  • ***
  • Posts: 2852
  • Country: us
Re: How to design hardware to connect with a Web Server ( With Ethernet)
« Reply #18 on: December 12, 2019, 11:57:53 pm »
I may have a chance to work on a project to design a product for a company. The equipment is suppose to control velocity and direction of a motor. Can't really discuss more than that. It's pretty simple do that and I know I can do this with ease.

But here is the catch, this company sells the machine that has this motor across the nation and they want to control this from the internet. And that's what I don't have any idea on how to do. So from the web I would choose the device I want to connect to and increase/decrease velocity for example.
I have built a number of low-volume devices that are controlled remotely via Ethernet.  I used the Beagle Board first, and have now moved to the Beagle Bone.  Somewhat more expensive than the
Arduinos and such, but a very capable computer.  It has a 200 MHz microcontroller built in which can be used when a lot of data needs to be pumped in or out.  Since it runs a full Linux OS, you can build all the networking and security in that might be needed.  (Not clear if this "motor" would be such that it could cause a hazard if operated in the wrong manner.)
You can do all the software development right on the Beagle, you don't have to cross-compile and download.

If it is some kind of motion control app, then there is Machinekit, which is usually used to run 3D printers and desktop machine tools, but can be used for any application where a programmed
path is required.

Jon
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf