Community discussions

MikroTik App
 
User avatar
eben
Member
Member
Topic Author
Posts: 479
Joined: Mon Feb 16, 2009 8:37 pm
Location: Somerset West, South Africa
Contact:

GSM modem not talking to RB433AH

Sun Feb 22, 2009 12:23 pm

I've got a brand new RB433AH on my bench that I've just loaded 3.20 onto.

I've also got a Wavecom WM02 GSM modem that I've connected to the serial port using an RS232 cable.

I've set the port speed to 19200,n,8,1 as that is how I use the modem when connected to PCs. I have two computers at different locations running "Servers Alive" that monitor servers, links and websites and send SMS messages if something goes wrong. I tested the modem on one of these machines, so I know that the modem works and there are no problems there.

Now the questions. I need to get hardware flow control set up, but when I try to change the flow control from "none" to "hardware", I get an error message "port does not support hardware flow control(6)". How do I enable hardware flow control?

I also need to "unbind" the serial port from the serial console so that the GSM modem can use it.
How do I do this?
 
User avatar
eben
Member
Member
Topic Author
Posts: 479
Joined: Mon Feb 16, 2009 8:37 pm
Location: Somerset West, South Africa
Contact:

Re: GSM modem not talking to RB433AH

Wed Feb 25, 2009 12:10 am

bump
 
User avatar
Chupaka
Forum Guru
Forum Guru
Posts: 8709
Joined: Mon Jun 19, 2006 11:15 pm
Location: Minsk, Belarus
Contact:

Re: GSM modem not talking to RB433AH

Sat Feb 28, 2009 1:14 am

I don't think it's possible at all. RB serial port is just board console
 
User avatar
eben
Member
Member
Topic Author
Posts: 479
Joined: Mon Feb 16, 2009 8:37 pm
Location: Somerset West, South Africa
Contact:

Re: GSM modem not talking to RB433AH

Sat Feb 28, 2009 8:20 am

I don't think it's possible at all. RB serial port is just board console
But, if you can connect a UPS to the serial port, then surely you can connect a modem to it ?
 
User avatar
nest
Forum Veteran
Forum Veteran
Posts: 822
Joined: Tue Feb 27, 2007 1:52 am
Location: UK
Contact:

Re: GSM modem not talking to RB433AH

Mon Mar 02, 2009 3:47 am

By default the terminal console is bound to the serial port, first disable the terminal console (with winbox this is in 'system', 'console'). Highlight serial0 and click the red x. You may find you have to reboot ROS to get it to reliably unbind itself from tying up the serial port. We certainly found this to be the case when using APC UPS connections on ROS 2.9.x. Not sure what happens with 3.x.

Also, this might prove informational? It does refer to the fact that many routerboards do not support hardware flow control and you'll be forced to using a null modem cable.
http://www.mikrotik.com/testdocs/ros/3. ... serial.php

Can't help you any further.

Ron.
 
User avatar
eben
Member
Member
Topic Author
Posts: 479
Joined: Mon Feb 16, 2009 8:37 pm
Location: Somerset West, South Africa
Contact:

Re: GSM modem not talking to RB433AH

Tue Mar 03, 2009 1:57 pm

This is what we have done...

We have set up a linux box as a breakout box using the following python code.
#!/usr/bin/python

import serial
import time
import binascii

device = serial.Serial(
    port='/dev/ttyS1',
    baudrate=19200,
    parity=serial.PARITY_NONE,
    stopbits=serial.STOPBITS_ONE,
    bytesize=serial.EIGHTBITS,
    timeout=0.005
)

wavecom = serial.Serial(
    port='/dev/ttyS0',
    baudrate=19200,
    parity=serial.PARITY_NONE,
    stopbits=serial.STOPBITS_ONE,
    bytesize=serial.EIGHTBITS,
    timeout=0.005
)

device.open()
wavecom.open()

print device.isOpen()
print wavecom.isOpen()

while True:
    from_device = device.readline()
    if (len(from_device) > 0):
        print 'Device -> Wavecom [%d]: (%s) %s' % (len(from_device), binascii.hexlify(from_device), from_device)
        wavecom.write(from_device)
    from_wavecom = wavecom.readline()
    if (len(from_wavecom) > 0):
        print 'Wavecom -> Device [%d]: (%s) %s' % (len(from_wavecom), binascii.hexlify(from_wavecom), from_wavecom)
        device.write(from_wavecom)
    
device.close()
wavecom.close()

This is the output


True
True
Device -> Wavecom [3]: (1b0d0a)

Device -> Wavecom [4]: (41540d0a) AT

Wavecom -> Device [2]: (0d0a)

Wavecom -> Device [4]: (4f4b0d0a) OK

Device -> Wavecom [11]: (41542b434d47463d300d0a) AT+CMGF=0

Wavecom -> Device [2]: (0d0a)

Wavecom -> Device [4]: (4f4b0d0a) OK

Device -> Wavecom [11]: (41542b434d47533d31370d) AT+CMGS=17
Wavecom -> Device [2]: (0d0a)

Wavecom -> Device [2]: (3e20) >
Device -> Wavecom [47]: (303539313732323831393931303130303041383137303033313330323035303030303035453833323942464430361a) 05917228199101000A817003130205000005E8329BFD06
Wavecom -> Device [2]: (0d0a)

Wavecom -> Device [11]: (2b434d47533a2031350d0a) +CMGS: 15

Wavecom -> Device [2]: (0d0a)

Wavecom -> Device [4]: (4f4b0d0a) OK




As you can see from this, there is a 5ms+ delay in routing the packets .

The result of this is that the GSM modem now sends SMS messages perfectly without the timeout error message appearing.

BUT as soon as we remove the soft "breakout box", the RB433AH timeouts again.

Therefore the question arises - Why must the comms between the modem and the router board be slowed down and how is this done?
 
User avatar
nest
Forum Veteran
Forum Veteran
Posts: 822
Joined: Tue Feb 27, 2007 1:52 am
Location: UK
Contact:

Re: GSM modem not talking to RB433AH

Tue Mar 03, 2009 11:37 pm

Are you saying if you insert a 5mS delay between commands and replies it works?
 
User avatar
eben
Member
Member
Topic Author
Posts: 479
Joined: Mon Feb 16, 2009 8:37 pm
Location: Somerset West, South Africa
Contact:

Re: GSM modem not talking to RB433AH

Wed Mar 04, 2009 7:37 am

Are you saying if you insert a 5mS delay between commands and replies it works?
I'm saying that if I delay each command that the RB issues by 5ms then it works.
 
User avatar
eben
Member
Member
Topic Author
Posts: 479
Joined: Mon Feb 16, 2009 8:37 pm
Location: Somerset West, South Africa
Contact:

Re: GSM modem not talking to RB433AH

Wed Mar 04, 2009 7:52 am

I do need to add that when I had the whole lot working (with the soft break out box in place) the SMS command was amazing.

I really hope the guys at Mikrotik get this sorted out as I really want to make use of this functionality to report low voltage on my remote high sites.
 
User avatar
normis
MikroTik Support
MikroTik Support
Posts: 26378
Joined: Fri May 28, 2004 11:04 am
Location: Riga, Latvia

Re: GSM modem not talking to RB433AH

Thu Mar 05, 2009 10:51 am

none of the RB400 series support hardware flow control. if no flow control is used, then it works like described here: http://tldp.org/HOWTO/Serial-HOWTO-4.html#ss4.6

it's possible to use software flow control if other end supports it

Who is online

Users browsing this forum: bananaboy1101 and 112 guests