Re: Taking the red pill...

new topic     » goto parent     » topic index » view thread      » older message » newer message
katsmeow said...

Over the last couple of years, there's been an explosion of inexpensive devices on ebay(etc) to convert ethernet, usb, RS-422, RS-232, RS-485, etc back and forth. Previously these devices were large, slow, and expensive, now they are dongles or small cable warts, fast, and as cheap as $10, from hundreds of sellers. For examples:

https://www.ebay.com/itm/131833025902

https://www.ebay.com/itm/353453817112

You could also get a PCI RS-485/RS-422 interface card, although they are a bit more expensive.

https://www.ebay.com/itm/193926281281

That one is about $50 and I know StarTech makes one that's more like $100.

katsmeow said...

It should also be possible to interface tiny computers, such as the cheapest Raspi or Arduino, on lan or usb to allow bytes to flow in and out of the computer.

Most Raspberry Pi models include built-in Ethernet and all models support USB-to-Ethernet adapters. Several models also have Wi-Fi.

For Arduino you could get a pre-made Ethernet shield, which is basically the RS-485 to Ethernet device you listed above, but assembled into an easier package for Arduino.

In order to get a RS-485/RS-422 port on Raspberry Pi you'd have to use a GPIO-to-serial or USB-to-serial adapter as there's no native serial interface on those devices.

katsmeow said...

The ebay(etc) descriptions don't say much about how to actually operate the devices, how to command the device to send one bit or one byte or 64k bytes to the computer, or how the software on the computer is to detect this action, or initiate a transaction.

The first device you listed is just a USB-to-serial adapter for RS-485/RS-422. When you plug it in it should just show up as a new "COMx" port on Windows or "/dev/ttySx" device on Linux.

The second device is the actual Ethernet device which you would command and control via its proprietary serial (text-based) protocol. Their website has a PDF describing this: http://www.hi-flying.com/eport-e20 (see "Software Funtion" [sic] document).

katsmeow said...

Has anyone built anything like this, using OE (etc) to access this data? From the user's perspective, did your device resemble a hard drive, a static ram, an array bits on pins, a smart RS-422 port? Did it have analog inputs? Did it have command pins like a PIO chip, or software command ports? Did OE(etc) access each pin separately, or were global packets of data glommed? The protocols will be different tween the ethernet and usb, there's significant pros and cons for each system, what did you use and why?

I haven't per se, but I've worked with a variety of RS-485 devices and they all seem to operate as basic non-seekable text files. You write a command and read the result. You do have to use the operating system API for opening files since you have to configure the "file" as a serial port before it will actually operate correctly (see baud rate, parity, etc.)

Windows: https://www.xanthium.in/Serial-Port-Programming-using-Win32-API

Linux: https://blog.mbedded.ninja/programming/operating-systems/linux/linux-serial-ports-using-c-cpp/

katsmeow said...

Can you share or sell your solution?

Unfortunately I don't have an existing solution to offer but I can try to answer questions and point you in the right direction.

-Greg

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu