Arduio Mega and AM = Ethernet instead of usb

Support for Arduino in combination with Air Manager and Air Player

Moderators: russ, Ralph

Post Reply
Message
Author
freddehboy
Posts: 23
Joined: Fri Jun 16, 2017 10:05 pm

Arduio Mega and AM = Ethernet instead of usb

#1 Post by freddehboy »

Hi

I am planning using the Lib... Arduino Library (SiMessagePort)https://siminnovations.com/wiki/index.p ... agePort.29 for the comunication between the Arduino Mega and AM4 (pc side). The reason is I intend to use my ethernet module W5500 instead of the usb port. What am I need as a start does it find some guide to it?

Best regards Fredrik
____________________________________________
Computer: Windows 10, 64-bit, Intel i7 8700k, Asus ROG STRIX Z370-F GAMING, 16GB RAM and Asus GTX1080

Game control: Razer Nostromo, Keyboard, Saitek Pro Flight X-56 Rhino H.O.T.A.S.

User avatar
jph
Posts: 2846
Joined: Fri Apr 10, 2020 12:50 pm
Location: Somewhere over the rainbow..

Re: Arduio Mega and AM = Ethernet instead of usb

#2 Post by jph »

freddehboy wrote: Sun Jan 17, 2021 2:51 pm Hi

I am planning using the Lib... Arduino Library (SiMessagePort)https://siminnovations.com/wiki/index.p ... agePort.29 for the comunication between the Arduino Mega and AM4 (pc side). The reason is I intend to use my ethernet module W5500 instead of the usb port. What am I need as a start does it find some guide to it?

Best regards Fredrik
HI Fredrik
Someone may correct me, but the only way I can see that working is IF - and I dont think you can - configure the W5500 as a totally transparent VCP (virtual serial port) - so that the OS sees it as a 'REAL' serial port, hence - AM also sees it as a true (transparent) serial port for all intents and purposes. This is not what the W5500 unit was designed for afaik ?. It seems like a sledge hammer to crack a nut.

I must ask sir, WHY would you not want to simply hook up the arduino via a serial cable to a true serial port (well, a VCP via USB) on the AM PC ?
Regards,
Joe
Joe. CISSP, MSc.

freddehboy
Posts: 23
Joined: Fri Jun 16, 2017 10:05 pm

Re: Arduio Mega and AM = Ethernet instead of usb

#3 Post by freddehboy »

jph wrote: Mon Jan 18, 2021 11:09 am ... but the only way I can see that working is IF - and I dont think you can - configure the W5500 as a totally transparent VCP (virtual serial port) - so that the OS sees it as a 'REAL' serial port, hence - AM also sees it as a true (transparent) serial port for all intents and purposes.
Hi Joe

Thank´s for your reply :)

So the AM must see the connection from Arduino as a serial port?

In that is the case I will connect the Arduino through usb and not RJ45. I have asume that a Ethernet connection is far more stable than a usb connection ;)

If not more stable I will of cause rethink it :)
____________________________________________
Computer: Windows 10, 64-bit, Intel i7 8700k, Asus ROG STRIX Z370-F GAMING, 16GB RAM and Asus GTX1080

Game control: Razer Nostromo, Keyboard, Saitek Pro Flight X-56 Rhino H.O.T.A.S.

User avatar
Ralph
Posts: 7878
Joined: Tue Oct 27, 2015 7:02 pm
Location: De Steeg
Contact:

Re: Arduio Mega and AM = Ethernet instead of usb

#4 Post by Ralph »

I have never seen or heard about stability issues with USB, so I don't think you'll have to consider that as a potential problem. There's no ethernet/UDP connection as an option, so it's USB only.

User avatar
jph
Posts: 2846
Joined: Fri Apr 10, 2020 12:50 pm
Location: Somewhere over the rainbow..

Re: Arduio Mega and AM = Ethernet instead of usb

#5 Post by jph »

freddehboy wrote: Mon Jan 18, 2021 12:47 pm
jph wrote: Mon Jan 18, 2021 11:09 am ... but the only way I can see that working is IF - and I dont think you can - configure the W5500 as a totally transparent VCP (virtual serial port) - so that the OS sees it as a 'REAL' serial port, hence - AM also sees it as a true (transparent) serial port for all intents and purposes.
Hi Joe

Thank´s for your reply :)

So the AM must see the connection from Arduino as a serial port?

In that is the case I will connect the Arduino through usb and not RJ45. I have asume that a Ethernet connection is far more stable than a usb connection ;)

If not more stable I will of cause rethink it :)
Hi Fredrik,
You will have absolutely NO issues with stability over serial. It is not a case of Ethernet V USB , it is SERIAL - that is - a VCP via USB. The serial port is absolutely stable at the PC end. Also, the transmission is usually TTL, not true (old) rs232 where the capacitance of the cable could cause issues over a cable length of more than about 20 mtrs. With TTL, it is probably fine up to around 50 mtrs even at high baud rates. I just wouldnt bother about it ...
what distances are you intending to use ?

If distance isnt the issue, and possibly you think USB or Ethernet offers a higher transmission rate in duplex, then you are mistaken Fredrik. As AM NEEDS to be Serial standard, the type of conversion interface - USB - or - Ethernet - makes no difference. If a serial rate of, for instance 115KB, is ok for the job, then increasing it, by whatever means, will not offer anything to you as the speed of the arduino and PC transmission timing controlled by AM is the limiting factor - for a reason, it is perfectly fine and capable of doing the job - in fact, MORE than capable as far as inter hardware comms is concerned.

Joe
Joe. CISSP, MSc.

freddehboy
Posts: 23
Joined: Fri Jun 16, 2017 10:05 pm

Re: Arduio Mega and AM = Ethernet instead of usb

#6 Post by freddehboy »

The distance should be maximun 5mtrs :) It seams to be no issue. My I ask if you have Arduinoes mega for the AM?
____________________________________________
Computer: Windows 10, 64-bit, Intel i7 8700k, Asus ROG STRIX Z370-F GAMING, 16GB RAM and Asus GTX1080

Game control: Razer Nostromo, Keyboard, Saitek Pro Flight X-56 Rhino H.O.T.A.S.

User avatar
jph
Posts: 2846
Joined: Fri Apr 10, 2020 12:50 pm
Location: Somewhere over the rainbow..

Re: Arduio Mega and AM = Ethernet instead of usb

#7 Post by jph »

freddehboy wrote: Mon Jan 18, 2021 10:09 pm The distance should be maximun 5mtrs :) It seams to be no issue. My I ask if you have Arduinoes mega for the AM?
Absolutely correct :D
I was thinking of serial cable not usb to usb converter, hence usb signalling. DOH ! :mrgreen:
Joe. CISSP, MSc.

JackZ
Posts: 2262
Joined: Mon Feb 22, 2016 1:02 pm

Re: Arduio Mega and AM = Ethernet instead of usb

#8 Post by JackZ »

Hi.
If ever you want to go this route, using the messageport() features of AM is perfectly doable, but since you become responsible of the code inside the Arduino it's a different ballpark, since you'll have to program everything.
The message port only shares messages, it is then up to you to know what to do with those messages.

So as long as you add the proper Ethernet Libraries, it should work with two (BIG) constraints:
- you'll have to program everything on the Arduino side (the Ethernet communications, and what to do with then messaging system, ie, encoder decoding, hardware interfacing. For example, you'll have to implement the encoder acceleration routines yourself.
- The AM instruments will have to be adapted codewise, as the standard hardware function features will not work as is. So you'll have to "create" your own functions for each and every hardware you have (leds, buttons, encodes, etc..), since you can't reuse the standard hardware functions that dialog directly with the =Arduino flashed with the AM code (which you won't have in your case).
- The result of this is that you may also end up with memory problems on the Arduino side (considering the added libraries you will have to include for encoders, debouncing, ethernet shield interface). So a Arduino Mega 2560 which has slightly more memory space for the programs (when compared to an Arduino Uno) is a must.

But, as @jph said, if your only concern is the so-called USB reliability, the key here is to have a good (understand high quality semi-pro) powered USB hub with its own power supply and good cabling.
That way no need to use the Ethernet shield, and you can hook up multiple Arduino as needed while still retaining all the standard AM API hardware built-infunctions

My 10 cents.

Jacques
My YouTube Chanel on the A320 (Real SOPs by an Airline Pilot IRL):
https://www.youtube.com/playlist?list=P ... 0Q6SBASRqJ

Post Reply