 |
 |
 |
 |
| Using Fedora General support for current versions. Ask questions about Fedora and it's software that do not belong in any other forum. |

30th January 2012, 09:11 PM
|
|
Registered User
|
|
Join Date: Aug 2009
Location: Waldorf, Maryland
Posts: 6,102

|
|
|
Re: Serial port baudrate hard limit. Is it possible?
There is one other hack...
You need to know/find out if the application uses the termios library for setting the speed.
Then you create a substitute library function for cfsetospeed (and it must use the ioctl system call itself). Any input of speed would get substituted for the 9600 desired.
Once the library is linked into a shared module, you can force the application to use your substitution using the "LD_PRELOAD" environment variable to reference it.
One way to find out if it is using cfsetospeed is to create a stub - and output a text message and exit (or use the debugger and set a breakpoint).
|

30th January 2012, 09:31 PM
|
|
Registered User
|
|
Join Date: Jan 2012
Location: Portugal
Posts: 10

|
|
|
Re: Serial port baudrate hard limit. Is it possible?
Thanks.
Didn't know the "divisor 0" option.
---------- Post added at 09:31 PM ---------- Previous post was at 09:13 PM ----------
To Chilly Willy (both messages).
I see your point. And thanks for clarifying some issues.
As It is now, I'm assuming that the device is working properly at 9600, 8N1.
My problem is I am unable so set my program at baudrate 9600, because I must use a closed library and don't have information about setting the baudrate, only the port.
The shortcut I thought was trying to limit the maximum allowable speed of the PC serial console to 9600. This way the library could set the highest speed - being 9600 - and hopefully communicate with the device.
I know this was a long shortcut...
By know, I'm disassembling the library to look for a way to pass the baudrate as well.
|

30th January 2012, 09:39 PM
|
 |
Registered User
|
|
Join Date: Jul 2008
Posts: 1,239

|
|
|
Re: Serial port baudrate hard limit. Is it possible?
Correct my if I'm wrong, but I thought you HAD it communicating at one point & lost it. If so, try from that point & adjust the settings accordingly. (Serial ports can be a PITA, at time... so hang in there you'll get it)
BTW: the linux command to set this confuses the **** out of me so bare with me if I get a bit off in THAT area. I'm trying to hold my info to the port (HW) itself as that is where my experience / knowledge is. SORRY, if I'm messing you up any, if I really am please let me know.
__________________
Chilly Willy, Tux's little cousin...
By its very nature, Windows is a PANE!
Last edited by Chilly Willy; 30th January 2012 at 09:42 PM.
|

30th January 2012, 09:42 PM
|
|
Registered User
|
|
Join Date: Jan 2012
Location: Portugal
Posts: 10

|
|
|
Re: Serial port baudrate hard limit. Is it possible?
Thanks jpollard.
Your hint is really interesting, albeit looking complex for at this point,
I'll will really try it.
If I could do such a thing or change the parameter of an called function in the library, or recall it with the desired value, would just be great.
Many thanks to you and all.
|

30th January 2012, 09:48 PM
|
 |
Registered User
|
|
Join Date: Nov 2008
Location: Canada
Posts: 2,048

|
|
|
Re: Serial port baudrate hard limit. Is it possible?
Are you sure it's RS485 and at 9600? What is this; modbus or old d-bus (moneywell) turned way down? Also, RS485 depends heavily on timing so I sincerely doubt forcing a lower baud will work as expected.
|

30th January 2012, 09:48 PM
|
|
Registered User
|
|
Join Date: Aug 2009
Location: Waldorf, Maryland
Posts: 6,102

|
|
|
Re: Serial port baudrate hard limit. Is it possible?
Quote:
Originally Posted by jlourenco
Thanks jpollard.
Your hint is really interesting, albeit looking complex for at this point,
I'll will really try it.
If I could do such a thing or change the parameter of an called function in the library, or recall it with the desired value, would just be great.
Many thanks to you and all.
|
One option you have - do an "ldd" on the application and see if it uses the termios library. If it does, it actually becomes easier - as the library itself is available in source form. You could then make a local version of the library, and reference it via the LD_PRELOAD, and have it fixed.
Tracking down other libraries (such as its possible use of IOCTL directly) is harder, and makes targeted changes much more difficult.
|

30th January 2012, 10:14 PM
|
|
Registered User
|
|
Join Date: Jan 2012
Location: Portugal
Posts: 10

|
|
|
Re: Serial port baudrate hard limit. Is it possible?
Quote:
Originally Posted by Chilly Willy
Correct my if I'm wrong, but I thought you HAD it communicating at one point & lost it. If so, try from that point & adjust the settings accordingly. (Serial ports can be a PITA, at time... so hang in there you'll get it)
BTW: the linux command to set this confuses the **** out of me so bare with me if I get a bit off in THAT area. I'm trying to hold my info to the port (HW) itself as that is where my experience / knowledge is. SORRY, if I'm messing you up any, if I really am please let me know.
|
You are absolutely correct on the hardware info.
The clarification I need to make is that I am changing an older controller to a pc, I don't have the old source, I don't have the library source, the library documentation isn't complete regarding the serial port configuration, so I can't make my program communicate because of this lacking of information. The old one is working.
However I'm feeling that with the whole contributions you all made, I am going to put it to work. Well, sooner or later, that is...
To jpollard,
Ok, Ok. I'm getting it.
Many thanks.
(time to learn...)
---------- Post added at 10:14 PM ---------- Previous post was at 10:11 PM ----------
Quote:
Originally Posted by beaker_
Are you sure it's RS485 and at 9600? What is this; modbus or old d-bus (moneywell) turned way down? Also, RS485 depends heavily on timing so I sincerely doubt forcing a lower baud will work as expected.
|
I was about to reply:
I'm, pretty sure. Thanks.
Remembering that the communication is encrypted and can't "see it", just the amount of chars transmitted, I will revise my reply.
I'm almost sure and positively hoping that it is a "regular" RS-485.
Having taken a look at the serial line with an oscilloscope, it seemed like a RS-485. As far as I my frugal oscilloscope can show.
Last edited by jlourenco; 30th January 2012 at 10:25 PM.
Reason: correction
|

30th January 2012, 11:50 PM
|
 |
Registered User
|
|
Join Date: Jul 2008
Posts: 1,239

|
|
|
Re: Serial port baudrate hard limit. Is it possible?
So, you are going way beyond just trying to get a device working with a port. I wish you well... (& I, as you, believe you'll get it, in due time)
Not sure if I really understand what you mean by "changing an older controller to a pc", though... do you mean the rs-232 to rs-485?
__________________
Chilly Willy, Tux's little cousin...
By its very nature, Windows is a PANE!
Last edited by Chilly Willy; 30th January 2012 at 11:54 PM.
|

31st January 2012, 01:28 AM
|
|
Registered User
|
|
Join Date: Jan 2012
Location: Portugal
Posts: 10

|
|
|
Re: Serial port baudrate hard limit. Is it possible?
Quote:
Originally Posted by beaker_
Are you sure it's RS485 and at 9600? What is this; modbus or old d-bus (moneywell) turned way down? Also, RS485 depends heavily on timing so I sincerely doubt forcing a lower baud will work as expected.
|
Quote:
Originally Posted by Chilly Willy
So, you are going way beyond just trying to get a device working with a port. I wish you well... (& I, as you, believe you'll get it, in due time)
Not sure if I really understand what you mean by "changing an older controller to a pc", though... do you mean the rs-232 to rs-485?
|
No, no. The current "controller" connected to the device is a Freescale 68xx family microcontroller with "huge" 4KB of RAM and 4KB of flash (for code) and data storage. It is already using RS-485.
The idea is to swap it with an embedded Atom computer running Fedora 13 in order to add more features: data collection, running some business rules, allow upload and download of data and code over wlan to/from a centralized server, ... The model I'm using currently doesn't have RS-485 ports, hence the need for the RS-232 to RS-485 converter.
Thanks for your help and incentive.
|

31st January 2012, 02:18 AM
|
 |
Registered User
|
|
Join Date: Jul 2008
Posts: 1,239

|
|
|
Re: Serial port baudrate hard limit. Is it possible?
OK - the "fog" is clearing a bit & I THINK I'm beginning to see what your doing but still not 100% sure...
Just what IS this "device" & what is it actually used for? Maybe that would help me understand. (If I'm not being to nosy)
Just re-read what you had stated & I'm getting it now. But still would like to know a bit more about this, if I may ask...
So, to elaborate & see if I got this right:
You are wanting to take the "old outdated 'computer' that it originally ran on" & replace it with "something like a 'netbook' - running Fedora".
Do I have that analogy correct?
IIRC, that converter really shouldn't be that much of an issue, but it's been a LONG while since I've ever had to deal with one & then that was few & far between & maybe a hand full of times at most. So, I'm not gonna be of much help there, sorry.
__________________
Chilly Willy, Tux's little cousin...
By its very nature, Windows is a PANE!
Last edited by Chilly Willy; 31st January 2012 at 02:32 AM.
|

31st January 2012, 02:36 AM
|
 |
Registered User
|
|
Join Date: Nov 2008
Location: Canada
Posts: 2,048

|
|
|
Re: Serial port baudrate hard limit. Is it possible?
Sorry. It seamed odd to have RS-485 running so slow so I thought I'd ask a question no one else has.
O how do I say this... you're more intimate with that system than I am. Old proprietary systems were designed to generate revenue so... to be frank... you're at their mercy. I'd lay $20 on jpollards's directions but I wouldn't bet much more.
I guess the next logical question is; why not just tear everything out and put in your own?
|

31st January 2012, 12:23 PM
|
|
Registered User
|
|
Join Date: Jan 2012
Location: Portugal
Posts: 10

|
|
|
Re: Serial port baudrate hard limit. Is it possible?
Quote:
Originally Posted by Chilly Willy
OK - the "fog" is clearing a bit & I THINK I'm beginning to see what your doing but still not 100% sure...
Just what IS this "device" & what is it actually used for? Maybe that would help me understand. (If I'm not being to nosy)
Just re-read what you had stated & I'm getting it now. But still would like to know a bit more about this, if I may ask...
So, to elaborate & see if I got this right:
You are wanting to take the "old outdated 'computer' that it originally ran on" & replace it with "something like a 'netbook' - running Fedora".
Do I have that analogy correct?
IIRC, that converter really shouldn't be that much of an issue, but it's been a LONG while since I've ever had to deal with one & then that was few & far between & maybe a hand full of times at most. So, I'm not gonna be of much help there, sorry.
|
Yes, you're almost right. The only thing differing is that it won't be a "netbook" but an embedded computer (because of vibrations and durability). It will be an Atom-based but could also be an Arm-based embedded computer.
Thanks.
---------- Post added at 12:23 PM ---------- Previous post was at 11:58 AM ----------
Quote:
Originally Posted by beaker_
Sorry. It seamed odd to have RS-485 running so slow so I thought I'd ask a question no one else has.
O how do I say this... you're more intimate with that system than I am. Old proprietary systems were designed to generate revenue so... to be frank... you're at their mercy. I'd lay $20 on jpollards's directions but I wouldn't bet much more.
I guess the next logical question is; why not just tear everything out and put in your own?
|
I am glad you did. Hopefully it won't be the case. I have thought about it but had put it way; don't want even to think about it. RS-485 is troublesome enough...
But I'm not intimidated. Thanks. I'm happy as I haven't been for a long time. I do like this kind of challenges. How shall I put it? This is not a true reverse engineering task but sure is a "guessing" engineer one.
The problem of replacing all is that the kind of devices I am talking about are too expensive. And there are a few dozens of them, only for the first user. This is ought to be a partial upgrade with valuable added functionalities. As such, if one want to get into a market which has some significant installation base (same kind of devices), we are the ones that must dig around... Hope to be able to dig enough...
Thanks again.
Last edited by jlourenco; 31st January 2012 at 12:24 PM.
Reason: correction
|

31st January 2012, 05:45 PM
|
 |
Registered User
|
|
Join Date: Jul 2008
Posts: 1,239

|
|
|
Re: Serial port baudrate hard limit. Is it possible?
The "netbook" was in single quotes as I was using that as part of the analogy as an example of an ATOM BASED CPU'ed device that can be added. But yeah, it looks like I get the jest of what you are doing.
It looks like this old man (me) is gonna have to get another work place & dust off HIS electronic stuff & "play" as HE once did. Man, it's been to long & I'm forgetting WAY to much of this stuff, & then a lot of it has dramatically changed since way back when. But the ROOTS of it all still apply. So as long as I can remember THAT, I'll be OK. You bring a lot of old memories back to life & give me a few things to think about - maybe even some projects of my own. Also, as I think about this stuff, if I come across any ideas that may help in YOUR project, I'll pass them on...
__________________
Chilly Willy, Tux's little cousin...
By its very nature, Windows is a PANE!
Last edited by Chilly Willy; 31st January 2012 at 05:53 PM.
|

31st January 2012, 07:35 PM
|
 |
Registered User
|
|
Join Date: Nov 2008
Location: Canada
Posts: 2,048

|
|
|
Re: Serial port baudrate hard limit. Is it possible?
Quote:
|
This is not a true reverse engineering task but sure is a "guessing" engineer one.
|
I know you're having fun and I wish you the best of luck but remember, you will inherit all their problems. Just my $0.02.
If you make no headway: What kind of application are we discussing; process controls, commercial/industrial, hvac, speciality environment, power...? I ask because I sincerely think you're looking at a "Forced Upgrade" where you probably should say, 'I'm sorry but we're not moving forward (into the 21st century) any other way.'
Pop me a message sometime and I'll see if I can't line you up with something/someone. For ex., what I use today... front-end is basically Apache TomCat with either mysql or postgre so *nix is a no brainier and you can fill your boats with SOAP, XML or whatever tickles your fancy. Protocols are open and... well maybe you should investigate BACnet if that's your application (I'm guessing because of AD converter on the chip suggest DDC rather than PLC).
|

31st January 2012, 07:57 PM
|
 |
Registered User
|
|
Join Date: Jul 2008
Posts: 1,239

|
|
|
Re: Serial port baudrate hard limit. Is it possible?
I'm not sure, but it seems to me that there SHOULD be a way of eliminating that "serial bridge" (the rs-232 / rs-485) & use a more direct type of "bus". I think THAT would make life a whole lot easier with your project as far as the comm., programming, & functioning is concerned. But would it introduce any headaches as far as implementing such a thing is concerned? - Since the embedded approach is the way to go, now that I know what you are working with.
__________________
Chilly Willy, Tux's little cousin...
By its very nature, Windows is a PANE!
|
| Thread Tools |
Search this Thread |
|
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
Current GMT-time: 03:41 (Tuesday, 21-05-2013)
|
|
 |
 |
 |
 |
|
|