0

TCP to USB HID
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

TCP to USB HID

by Z28Z34man on Tue Feb 05, 2019 2:46 am

I have searched and haven't found exactly what i was looking for.

I have a project where I want to take TCP packets sent from a PLC (programmable logic controller) and write them out as a USB HID device. On the computer end it needs it to appear as typed text.

I have an unbranded mega 2560 R3 board and I just bought a Ethernet shield to play with to use a a prof of concept but i think an adafruit board with native USB HID would be a better option in the long run.

I am thinking a feather 32U4 adaloger and a ethernet wing would work well for this project. what are your thoughts? are there any good tutorials out there to give me a start. i have done a few small project with the mega board but by no means am I an expert.

Z28Z34man
 
Posts: 6
Joined: Tue Feb 05, 2019 1:38 am

Re: TCP to USB HID

by adafruit_support_mike on Tue Feb 05, 2019 5:13 am

Assuming you're using Ethernet to transmit the TCP packets, yeah: an Ethernet FeatherWing on a Feather 32u4 or Feather M0 would work.

It sounds like a straightforward signal processing application: get data from one device, modify it, and transmit the result to another device.

adafruit_support_mike
 
Posts: 55935
Joined: Thu Feb 11, 2010 2:51 pm

Re: TCP to USB HID

by Z28Z34man on Tue Feb 05, 2019 6:47 am

Would a metro M4 be better. I think I can get it to work as a TCP client but would prefer it being a TCP server. on the web page for the Ethernet feather wing it says TCP client only

Z28Z34man
 
Posts: 6
Joined: Tue Feb 05, 2019 1:38 am

Re: TCP to USB HID

by adafruit_support_mike on Wed Feb 06, 2019 12:51 am

The M4 is less likely to support the server code than an M0. The M4 uses a SAMD51 microcontroller, which is fairly new, so less code has been ported to it.

I'll check to see if the Arduino Ethernet library supports server code on an M0.

adafruit_support_mike
 
Posts: 55935
Joined: Thu Feb 11, 2010 2:51 pm

Re: TCP to USB HID

by Z28Z34man on Wed Feb 06, 2019 5:24 am

i think i got the hid keyboard understood in both arduino IDE and circuit python. Is there a good tutorial on TCP communications.

the PLC i am using is an automation direct productivity 1000. it can be both TCP client or server or it can work over UDP. i curently have the PLC set up as a TCP Client.
https://www.automationdirect.com/productivity/p1000

I have this project working in software with a program called TWedge but there is talks of changing out the workstation computers with zero clients and i think the adafruit board would act as a keyboard in that situation.

Z28Z34man
 
Posts: 6
Joined: Tue Feb 05, 2019 1:38 am

Re: TCP to USB HID

by Z28Z34man on Mon Feb 11, 2019 4:44 pm

I found that there is a modbuss TCP library for the arduino mega. do you know if there is a libray that will work with the feather M0

Z28Z34man
 
Posts: 6
Joined: Tue Feb 05, 2019 1:38 am

Re: TCP to USB HID

by adafruit_support_mike on Tue Feb 12, 2019 3:29 am

We don't know of any Modbus code for the SAMD21, but maybe someone from the community will have suggestions.

adafruit_support_mike
 
Posts: 55935
Joined: Thu Feb 11, 2010 2:51 pm

Re: TCP to USB HID

by Z28Z34man on Tue Feb 12, 2019 8:10 am

I got the PLC talking to a knock off mega using the web server example sketch so there is no need for modbuss now. The mega board I have dose not have the pins on it to reset it and allow a flash to the chip to allow usb keyboard emulation so now I just need to order the adafruit boards and test it with it

Z28Z34man
 
Posts: 6
Joined: Tue Feb 05, 2019 1:38 am

Please be positive and constructive with your questions and comments.