Welcome, Guest. Please login or register.

Author Topic: Connecting Ethernet device to serial port  (Read 19026 times)

Description:

0 Members and 1 Guest are viewing this topic.

Offline motorollinTopic starter

  • Hero Member
  • *****
  • Join Date: Nov 2005
  • Posts: 8669
    • Show only replies by motorollin
Re: Connecting Ethernet device to serial port
« Reply #74 from previous page: May 29, 2008, 12:26:35 PM »
By the way there is practically no documentation about what is actually happening "behind the scenes", which is why we don't know how to replicate it. That's why we're having to "reverse engineer" it piece by piece.

--
moto
Code: [Select]
10  IT\'S THE FINAL COUNTDOWN
20  FOR C = 1 TO 2
30     DA-NA-NAAAA-NAAAA DA-NA-NA-NA-NAAAA
40     DA-NA-NAAAA-NAAAA DA-NA-NA-NA-NA-NA-NAAAAA
50  NEXT C
60  NA-NA-NAAAA
70  NA-NA NA-NA-NA-NA-NAAAA NAAA-NAAAAAAAAAAA
80  GOTO 10
 

Offline Speelgoedmannetje

  • Hero Member
  • *****
  • Join Date: Oct 2002
  • Posts: 9656
    • Show only replies by Speelgoedmannetje
Re: Connecting Ethernet device to serial port
« Reply #75 on: May 29, 2008, 12:28:46 PM »
The datasheet must have all the data you need to use that thing.
And the canary said: \'chirp\'
 

Offline motorollinTopic starter

  • Hero Member
  • *****
  • Join Date: Nov 2005
  • Posts: 8669
    • Show only replies by motorollin
Re: Connecting Ethernet device to serial port
« Reply #76 on: May 29, 2008, 12:56:41 PM »
Yes, it has all the information you need to use it via the HomeSeer interface, but no information which is useful for developing your own interface.

--
moto
Code: [Select]
10  IT\'S THE FINAL COUNTDOWN
20  FOR C = 1 TO 2
30     DA-NA-NAAAA-NAAAA DA-NA-NA-NA-NAAAA
40     DA-NA-NAAAA-NAAAA DA-NA-NA-NA-NA-NA-NAAAAA
50  NEXT C
60  NA-NA-NAAAA
70  NA-NA NA-NA-NA-NA-NAAAA NAAA-NAAAAAAAAAAA
80  GOTO 10
 

Offline bloodline

  • Master Sock Abuser
  • Hero Member
  • *****
  • Join Date: Mar 2002
  • Posts: 12113
    • Show only replies by bloodline
    • http://www.troubled-mind.com
Re: Connecting Ethernet device to serial port
« Reply #77 on: May 29, 2008, 01:43:34 PM »
Quote

motorollin wrote:

Bloodline, you reckon it's quite simple to set up a virtual COM port under OS X. I have Googled it but can't find out how. Would you mind pointing me in the right direction?

--
moto


What you need to do is set up a loopback device... I used to use them all the time before we had Rewire and Core Audio/Network MIDI.

It craetes two COM device on the system that are actually conencted so that you put data in to one and it pop out the other... then you connenct one end to your Terminal and the other end to the MultiCOM software.


-Edit- If you can't do it in software... use two serial ports on the Mac and put a Null Modem cable between them... Einfach!:-)

Offline Speelgoedmannetje

  • Hero Member
  • *****
  • Join Date: Oct 2002
  • Posts: 9656
    • Show only replies by Speelgoedmannetje
Re: Connecting Ethernet device to serial port
« Reply #78 on: May 29, 2008, 02:31:37 PM »
Quote

motorollin wrote:
Yes, it has all the information you need to use it via the HomeSeer interface, but no information which is useful for developing your own interface.

--
moto
Ehm, I don't really know what kind of device you use, and what kind of software you use. But I've got the idea you don't have the right datasheet. A normal datasheet should describe every single bit a programmer and  needs to know. Maybe it also has an SDK which you can use (which makes things much easier).
And the canary said: \'chirp\'
 

Offline motorollinTopic starter

  • Hero Member
  • *****
  • Join Date: Nov 2005
  • Posts: 8669
    • Show only replies by motorollin
Re: Connecting Ethernet device to serial port
« Reply #79 on: May 29, 2008, 02:40:57 PM »
Quote
bloodline wrote:
What you need to do is set up a loopback device... I used to use them all the time before we had Rewire and Core Audio/Network MIDI.

It craetes two COM device on the system that are actually conencted so that you put data in to one and it pop out the other... then you connenct one end to your Terminal and the other end to the MultiCOM software.

Do you know how to do it with serial ports in BSD? (Will Google loopback devices in the meantime)

Quote
bloodline wrote:
-Edit- If you can't do it in software... use two serial ports on the Mac and put a Null Modem cable between them... Einfach!:-)

That's the fall-back option :-)

--
moto
Code: [Select]
10  IT\'S THE FINAL COUNTDOWN
20  FOR C = 1 TO 2
30     DA-NA-NAAAA-NAAAA DA-NA-NA-NA-NAAAA
40     DA-NA-NAAAA-NAAAA DA-NA-NA-NA-NA-NA-NAAAAA
50  NEXT C
60  NA-NA-NAAAA
70  NA-NA NA-NA-NA-NA-NAAAA NAAA-NAAAAAAAAAAA
80  GOTO 10
 

Offline motorollinTopic starter

  • Hero Member
  • *****
  • Join Date: Nov 2005
  • Posts: 8669
    • Show only replies by motorollin
Re: Connecting Ethernet device to serial port
« Reply #80 on: May 29, 2008, 03:24:15 PM »
BTW just soldered up a serial cable and connected a PC running a terminal to the Mac Mini via its USB serial port. Ran Multicom and configured it to bridge the USB serial port to the IP address and port of the RFXCOM, typed a command in to the terminal emulator on the PC and it worked! Soooooo Multicom works as a redirector. Just need a virtual serial port or an additional USB one to loop back and we should be set! :-D

--
moto
Code: [Select]
10  IT\'S THE FINAL COUNTDOWN
20  FOR C = 1 TO 2
30     DA-NA-NAAAA-NAAAA DA-NA-NA-NA-NAAAA
40     DA-NA-NAAAA-NAAAA DA-NA-NA-NA-NA-NA-NAAAAA
50  NEXT C
60  NA-NA-NAAAA
70  NA-NA NA-NA-NA-NA-NAAAA NAAA-NAAAAAAAAAAA
80  GOTO 10
 

Offline motorollinTopic starter

  • Hero Member
  • *****
  • Join Date: Nov 2005
  • Posts: 8669
    • Show only replies by motorollin
Re: Connecting Ethernet device to serial port
« Reply #81 on: May 30, 2008, 01:36:36 PM »
Got another USB serial port and created a serial port loopback. I then pointed my test Applescript at one of the ports, and told Multicom to redirect the other one to the IP and port of the RFXCOM. Sent a serial command from my Applescript and....... it worked :-D I also knocked up a listener app which can detect commands coming back the other way and act upon them. So I now have total control over the RFXCOM from Applescript!

Anyone every used socat? It's a redirector which supports pty ports, so I believe I can use it to create a software loopback. The syntax looks extremely complicated though, and I don't really know what I'm doing!

Thanks for all the help so far :-)

--
moto
Code: [Select]
10  IT\'S THE FINAL COUNTDOWN
20  FOR C = 1 TO 2
30     DA-NA-NAAAA-NAAAA DA-NA-NA-NA-NAAAA
40     DA-NA-NAAAA-NAAAA DA-NA-NA-NA-NA-NA-NAAAAA
50  NEXT C
60  NA-NA-NAAAA
70  NA-NA NA-NA-NA-NA-NAAAA NAAA-NAAAAAAAAAAA
80  GOTO 10
 

Offline bloodline

  • Master Sock Abuser
  • Hero Member
  • *****
  • Join Date: Mar 2002
  • Posts: 12113
    • Show only replies by bloodline
    • http://www.troubled-mind.com
Re: Connecting Ethernet device to serial port
« Reply #82 on: May 30, 2008, 02:28:25 PM »
Quote

motorollin wrote:
Got another USB serial port and created a serial port loopback. I then pointed my test Applescript at one of the ports, and told Multicom to redirect the other one to the IP and port of the RFXCOM. Sent a serial command from my Applescript and....... it worked :-D


Had you ever doubts?!?! ;-)

Now can we please figure out a way to get my damn PowerMac going :-D


Offline motorollinTopic starter

  • Hero Member
  • *****
  • Join Date: Nov 2005
  • Posts: 8669
    • Show only replies by motorollin
Re: Connecting Ethernet device to serial port
« Reply #83 on: May 30, 2008, 02:42:03 PM »
Quote
bloodline wrote:
Had you ever doubts?!?! ;-)

Of course not! Ok, well maybe a bit :-P It's an interim solution IMO. We need bidirectional control, which due to the way the RFXCOM works requires two separate connections on different IP ports. That means we need two serial interfaces, so two serial loopbacks, and therefore four serial ports! If I can get it working with socat then I will be very happy as it will be an entirely software solution.

Quote
bloodline wrote:
Now can we please figure out a way to get my damn PowerMac going :-D

BUY A KEYBOARD! :-P

--
moto
Code: [Select]
10  IT\'S THE FINAL COUNTDOWN
20  FOR C = 1 TO 2
30     DA-NA-NAAAA-NAAAA DA-NA-NA-NA-NAAAA
40     DA-NA-NAAAA-NAAAA DA-NA-NA-NA-NA-NA-NAAAAA
50  NEXT C
60  NA-NA-NAAAA
70  NA-NA NA-NA-NA-NA-NAAAA NAAA-NAAAAAAAAAAA
80  GOTO 10
 

Offline bloodline

  • Master Sock Abuser
  • Hero Member
  • *****
  • Join Date: Mar 2002
  • Posts: 12113
    • Show only replies by bloodline
    • http://www.troubled-mind.com
Re: Connecting Ethernet device to serial port
« Reply #84 on: May 30, 2008, 02:50:25 PM »
Quote

motorollin wrote:
Quote
bloodline wrote:
Had you ever doubts?!?! ;-)

Of course not! Ok, well maybe a bit :-P It's an interim solution IMO. We need bidirectional control, which due to the way the RFXCOM works requires two separate connections on different IP ports. That means we need two serial interfaces, so two serial loopbacks, and therefore four serial ports! If I can get it working with socat then I will be very happy as it will be an entirely software solution.


A software solution is totally possible... I'm pretty sure you can use pipes or something... I foget how this all works on Unix...

But since the hardware solution proved it would work, I'm feeling quite satisfied!

Quote

Quote
bloodline wrote:
Now can we please figure out a way to get my damn PowerMac going :-D

BUY A KEYBOARD! :-P


To that sir, I say bum!

Offline motorollinTopic starter

  • Hero Member
  • *****
  • Join Date: Nov 2005
  • Posts: 8669
    • Show only replies by motorollin
Re: Connecting Ethernet device to serial port
« Reply #85 on: May 30, 2008, 04:02:30 PM »
Quote
bloodline wrote:
A software solution is totally possible... I'm pretty sure you can use pipes or something... I foget how this all works on Unix...

I'm waiting for a reply on a Linux forum where I asked for help with the syntax for socat. Hopefully that will do the trick!

Quote
bloodline wrote:
But since the hardware solution proved it would work, I'm feeling quite satisfied!

Yeah, it's great that we finally got it working! At least now I can get the Applescript to a level where it can replace Homeseer, and then it's goodbye Parallels :-D

Quote
bloodline wrote:
To that sir, I say bum!

Hmm, not really sure how to respond to your bum...

--
moto
Code: [Select]
10  IT\'S THE FINAL COUNTDOWN
20  FOR C = 1 TO 2
30     DA-NA-NAAAA-NAAAA DA-NA-NA-NA-NAAAA
40     DA-NA-NAAAA-NAAAA DA-NA-NA-NA-NA-NA-NAAAAA
50  NEXT C
60  NA-NA-NAAAA
70  NA-NA NA-NA-NA-NA-NAAAA NAAA-NAAAAAAAAAAA
80  GOTO 10
 

Offline motorollinTopic starter

  • Hero Member
  • *****
  • Join Date: Nov 2005
  • Posts: 8669
    • Show only replies by motorollin
Re: Connecting Ethernet device to serial port
« Reply #86 on: May 30, 2008, 06:56:11 PM »
Done it :-D Here is the syntax for socat:

socat GOPEN:/dev/ptyp0 TCP:10.0.1.93:10002

Then I configured my app to send the commands to /dev/ttyp0 (the other side of the pty) and it worked! :-D

Cheers guys!

--
moto
Code: [Select]
10  IT\'S THE FINAL COUNTDOWN
20  FOR C = 1 TO 2
30     DA-NA-NAAAA-NAAAA DA-NA-NA-NA-NAAAA
40     DA-NA-NAAAA-NAAAA DA-NA-NA-NA-NA-NA-NAAAAA
50  NEXT C
60  NA-NA-NAAAA
70  NA-NA NA-NA-NA-NA-NAAAA NAAA-NAAAAAAAAAAA
80  GOTO 10
 

Offline bloodline

  • Master Sock Abuser
  • Hero Member
  • *****
  • Join Date: Mar 2002
  • Posts: 12113
    • Show only replies by bloodline
    • http://www.troubled-mind.com
Re: Connecting Ethernet device to serial port
« Reply #87 on: May 30, 2008, 10:51:38 PM »
:-D

We rule, except when it comes to doing something simple... Like getting an old PowerMac up headless...

Offline motorollinTopic starter

  • Hero Member
  • *****
  • Join Date: Nov 2005
  • Posts: 8669
    • Show only replies by motorollin
Re: Connecting Ethernet device to serial port
« Reply #88 on: May 31, 2008, 09:28:13 AM »
Quote
bloodline wrote:
:-D

We rule, except when it comes to doing something simple... Like getting an old PowerMac up headless...

Well we don't even know whether that is working. The autorun VNC CD was a great idea, but obviously not much help if the OS isn't up!

When's your birthday? I'll get you the bloody VGA adapter! ;-)

--
moto
Code: [Select]
10  IT\'S THE FINAL COUNTDOWN
20  FOR C = 1 TO 2
30     DA-NA-NAAAA-NAAAA DA-NA-NA-NA-NAAAA
40     DA-NA-NAAAA-NAAAA DA-NA-NA-NA-NA-NA-NAAAAA
50  NEXT C
60  NA-NA-NAAAA
70  NA-NA NA-NA-NA-NA-NAAAA NAAA-NAAAAAAAAAAA
80  GOTO 10
 

Offline bloodline

  • Master Sock Abuser
  • Hero Member
  • *****
  • Join Date: Mar 2002
  • Posts: 12113
    • Show only replies by bloodline
    • http://www.troubled-mind.com
Re: Connecting Ethernet device to serial port
« Reply #89 on: May 31, 2008, 12:52:57 PM »
Quote

motorollin wrote:
Quote
bloodline wrote:
:-D

We rule, except when it comes to doing something simple... Like getting an old PowerMac up headless...

Well we don't even know whether that is working. The autorun VNC CD was a great idea, but obviously not much help if the OS isn't up!

When's your birthday? I'll get you the bloody VGA adapter! ;-)


:lol: But the point is I don't want an adaptor! It's all about not having to get any adaptors to support legacy ports... The challenge was there... we failed.