LinuxQuestions.org
Did you know LQ has a Linux Hardware Compatibility List?
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware > Linux - Embedded & Single-board computer
User Name
Password
Linux - Embedded & Single-board computer This forum is for the discussion of Linux on both embedded devices and single-board computers (such as the Raspberry Pi, BeagleBoard and PandaBoard). Discussions involving Arduino, plug computers and other micro-controller like devices are also welcome.

Notices



Reply
 
Search this Thread
Old 02-24-2010, 09:40 AM   #1
Hark28
LQ Newbie
 
Registered: Feb 2010
Posts: 10

Rep: Reputation: 0
windows application -> dial in -> linux embedded -> rs485 -> external device


Dear forum members,

i'm new to this forum and also beginner if it comes to linux. What i want to achieve is the following:

Currently i'm trying to establish a connection between a windows application and a linux embedded computer connected to a external rs485 device. The external rs485 device, an energy meter, needs to be read out by the windows application.
The embedded computer has an internal modem ttyM2 and two rs485 ports ttyM0 and ttyM1.
Current status is that i have established connection from the application to the embedded computer. I added a command line in /etc/inittab to accept the incoming call -> 1:123:respawn:/sbin/getty –I “ATS0=1” 115200 ttyM2 vt100
When i'm dialing in the internal modem of the embedded computer answers the call and then i have connection.
The following task is to connect the internal modem with the rs485 device to read out the energy meter.
Is it possible to make some sort of symbolic link of the modem serial port with the external rs485 port?
Can somebody put me on the right way to achieve this?

Looking forward for any suggestions.

Mark
 
Old 02-25-2010, 08:21 AM   #2
smoker
Senior Member
 
Registered: Oct 2004
Distribution: Fedora Core 4, 12, 13, 14, 15, 17
Posts: 2,279

Rep: Reputation: 248Reputation: 248Reputation: 248
You can get the embedded computer to read the data from the meter first. Then you can manipulate the data so that the windows computer can access it. Or, once you have a connection, you can send commands to access data on the embedded computer, or access ports that are linked to the meter.

Mainly you need to understand the input/output interface that the meter provides. Without that you are fishing. Has it got a manual ?
 
Old 02-25-2010, 09:24 AM   #3
michaelk
Moderator
 
Registered: Aug 2002
Posts: 12,043

Rep: Reputation: 757Reputation: 757Reputation: 757Reputation: 757Reputation: 757Reputation: 757Reputation: 757
Did you write the windows application or is it something you purchased i.e. came with the energy meter?
 
Old 02-25-2010, 10:33 AM   #4
Hark28
LQ Newbie
 
Registered: Feb 2010
Posts: 10

Original Poster
Rep: Reputation: 0
The windows application comes with the energy meter. With this application i can call to the embedded computer and make a connection. Only now i need to make some sort of route from internal modem to external rs485 port.
 
Old 02-25-2010, 10:39 AM   #5
michaelk
Moderator
 
Registered: Aug 2002
Posts: 12,043

Rep: Reputation: 757Reputation: 757Reputation: 757Reputation: 757Reputation: 757Reputation: 757Reputation: 757
As smoker suggested you need to know how the application communicates with the meter.
 
Old 02-25-2010, 11:25 AM   #6
smoker
Senior Member
 
Registered: Oct 2004
Distribution: Fedora Core 4, 12, 13, 14, 15, 17
Posts: 2,279

Rep: Reputation: 248Reputation: 248Reputation: 248
1)Was the embedded computer something that came with the meter ?
2)Why are you doing things this way ?
3)Can't you connect the windows computer directly to the meter ?

If (1) is true, then they must have given you some protocols to communicate with.

Are you trying to set it up to access remotely on a phoneline ?

Have you got a web link for the meter manufacturer/provider ?

Last edited by smoker; 02-25-2010 at 11:26 AM.
 
Old 02-26-2010, 02:55 AM   #7
Hark28
LQ Newbie
 
Registered: Feb 2010
Posts: 10

Original Poster
Rep: Reputation: 0
Smoker,

1) The embedded computer did not came with the meter;
2) The embedded computer has more funcionalities then the existing modem;
3) No i can't connect it directly to windows;

Maybe my description was not completly clear.

The standard situation is as follows:
- windows application (from meter manufacturer);
- energymeter;
- modem for energy meter (modem is special for this meter);

Custom situation:
So what i want is to replace the existing modem that comes with the energy meter with the embedded computer that has an internal modem and external rs232/rs485 port.
The energy meter has a external rs485 port because, in the standard situation, you can connect multiple meters on this bus and read them out with one modem.
 
Old 02-26-2010, 06:42 AM   #8
smoker
Senior Member
 
Registered: Oct 2004
Distribution: Fedora Core 4, 12, 13, 14, 15, 17
Posts: 2,279

Rep: Reputation: 248Reputation: 248Reputation: 248
You still need to find out what the API is for accessing the meter. The windows software obviously knows it, but you need to find out what commands it responds to.

Have you got a web link for the meter ?

If so, then maybe I can dig something up.
If you have and you keep it quiet, I don't know what to look for.

Last edited by smoker; 02-26-2010 at 06:44 AM.
 
Old 02-26-2010, 11:58 AM   #9
schneidz
Senior Member
 
Registered: May 2005
Location: boston, usa
Distribution: fc-15/ fc-20-live-usb/ aix
Posts: 4,139

Rep: Reputation: 638Reputation: 638Reputation: 638Reputation: 638Reputation: 638Reputation: 638
assumming that the windows software is not open source, there is no easy way to mimic that functionality in linux.
is it possible to cat the serial port that the meter is connecting to and od dump/ grep that info to a text file ?

we can worry about windows later but i would imagine it would be like transferring that text file to windows and using it as input to your energy meter software.
 
Old 02-26-2010, 05:10 PM   #10
smoker
Senior Member
 
Registered: Oct 2004
Distribution: Fedora Core 4, 12, 13, 14, 15, 17
Posts: 2,279

Rep: Reputation: 248Reputation: 248Reputation: 248
I would have thought that there has to be some input to the meter to make it start transmitting data.
It doesn't just "know" when to output some data, it has to be queried. The windows software dials up the modem and the modem passes the commands through to the meter, and the meter responds. But what are those commands ? How is the meter storing the data ?


I suggest you get something like this http://www.analogx.com/CONTENTS/down...twork/pmon.htm
and capture all the data that's passed by the software when you have connected the meter to its normal modem.
Once you have an idea what's happening, you can duplicate it on the linux board.
 
Old 02-28-2010, 04:42 AM   #11
Hark28
LQ Newbie
 
Registered: Feb 2010
Posts: 10

Original Poster
Rep: Reputation: 0
Thanks for the great response guys.

I can't check it at the moment, but I did this cat of the serial port before on which i could see what the program was sending. The communication protocol is dlms and the commands are as in the attachment.

When i did "cat /dev/ttyM2" (modem) i could see that the windows program was sending the request message.
Attached Images
File Type: jpg message_def.jpg (63.5 KB, 8 views)

Last edited by Hark28; 02-28-2010 at 04:43 AM.
 
Old 02-28-2010, 07:22 AM   #12
michaelk
Moderator
 
Registered: Aug 2002
Posts: 12,043

Rep: Reputation: 757Reputation: 757Reputation: 757Reputation: 757Reputation: 757Reputation: 757Reputation: 757
It appears that it is basic command response except for maybe programming so all you are doing is repeating incomming messages to the other port. It would be possible to add some message error checking. What special functionality do you want to accomplish with the embedded computer?
 
Old 03-01-2010, 08:26 AM   #13
Hark28
LQ Newbie
 
Registered: Feb 2010
Posts: 10

Original Poster
Rep: Reputation: 0
Oke that sounds good!
So is there a way to just connect the internal modem port with the external serial port? Isn't there a standard setup for this?
 
Old 03-01-2010, 09:20 AM   #14
smoker
Senior Member
 
Registered: Oct 2004
Distribution: Fedora Core 4, 12, 13, 14, 15, 17
Posts: 2,279

Rep: Reputation: 248Reputation: 248Reputation: 248
Quote:
Originally Posted by Hark28 View Post
Oke that sounds good!
So is there a way to just connect the internal modem port with the external serial port? Isn't there a standard setup for this?
http://www.linuxquestions.org/questi...o-tty2-480257/

But all you are doing is passing data straight through. Pretty pointless really. If you want to use the advanced functionality of the embedded computer you need to do some processing before you output to the other port.
 
Old 03-01-2010, 11:13 AM   #15
Hark28
LQ Newbie
 
Registered: Feb 2010
Posts: 10

Original Poster
Rep: Reputation: 0
Thank you smoker,

Of course i'm not using the embedded computer only for this operation, but i first need to be able just use it as modem for the meter.
As far as i can understand of the post you pointed me, the mknod command is making a new symbolic link of the existing port?

I have a external port ttyM0 with the rs485 device connected to it and ttyM2 which is the internal modem.
I found "socat" command to link serial ports but is not working on the embedded computer.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Embedded Linux application with Flash GUI? _ian_ Linux - Mobile 6 04-21-2009 08:09 AM
Embedded Linux for Arm needing Modem/Cell phone dial & networking ability jamesbomkamp Linux - Networking 0 02-24-2009 04:50 PM
Will an external dial-up device usually work? jamesg Linux - Newbie 4 12-17-2006 02:25 PM
linux embedded application jfsebastian Linux - General 4 10-24-2006 01:21 PM
Need help with embedded linux device nabeelakhtar Linux - Laptop and Netbook 3 12-25-2004 01:12 AM


All times are GMT -5. The time now is 04:38 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration