Yes, you were right on the nail about the signals.
I�ve fine-tuned my setup a little more based on new Siemens specifications I've found. I�ve even managed to activate HW control via an AT command, but it only works after passing the first 3 or 4 AT commands. It is not permanent and I still need to run the stty command each time after starting Kannel to get rid of the "errno 35" and make it work. After that, it works flawlessly.
modems.conf:
group = modems id = siemens_c60 name = "Siemens C60" init-string = "AT+CSMS=1+CNMI=1,2,0,0,1" enable-hwhs = "AT\Q3" need-sleep = true
Do you know any easy way to disable HW flow control at start? A simple way could be to modify the start script: add a sleep of 1 or 2 seconds and the stty command there, but it is far from perfect and not precisely neat (but it might work anyway).
To change it on the source code I suppose I have to change:
tios.c_cflag |= CRTSCTS; /* enable hardware flow control */
to
tios.c_cflag &= ~CRTSCTS; /* enable hardware flow control */
and recompile. Is that right? It could be great to have a .conf directive to disable that isn�t it?
Thank you for your great support, At 07:53 28/03/2004, you wrote:
Good work!
And it was, as I expected, the flow control signals that was missing from your cellular..
/ Hkan
Alejandro Guerrieri wrote:
Yes, I have the source code. In fact I am running a version I compiled myself.
I've checked smsc_at2c.c and found the section you were talking about. I've tried playing with the settings, and I finnaly got it working, but on a very ugly mode.
I've checked the stty docs and I mimicked all the settings kannel sets on a stty command.
Since the problems persisted, I've obtained an old Siemens spec about the AT command set for some Siemens phones. I didn�t find any command to set HW flow control, so I tried disabling it from stty after starting kannel:
stty -f /dev/phone -crtscts
That�s it:
1. Start kannel. 2. Inmediately after, run the stty command above mentioned 3. Voil�!:
2004-03-28 01:04:26 [5] DEBUG: AT2[/dev/phone]: device opened 2004-03-28 01:04:27 [5] DEBUG: AT2[/dev/phone]: device opened 2004-03-28 01:04:27 [5] INFO: AT2[/dev/phone]: init device 2004-03-28 01:04:27 [5] INFO: AT2[/dev/phone]: speed set to 57600 2004-03-28 01:04:27 [5] DEBUG: AT2[/dev/phone]: --> AT^M 2004-03-28 01:04:29 [4] DEBUG: Started thread 7 (gw/bb_boxc.c:function) 2004-03-28 01:04:29 [7] INFO: Client connected from <127.0.0.1> 2004-03-28 01:04:29 [7] DEBUG: Started thread 8 (gw/bb_boxc.c:boxc_sender)
(Here it failed because we didn't run the stty command yet)
2004-03-28 01:04:29 [5] DEBUG: AT2[/dev/phone]: write failed with errno 35
(We ran the stty command here)
2004-03-28 01:04:33 [5] DEBUG: AT2[/dev/phone]: --> AT^M 2004-03-28 01:04:34 [5] DEBUG: AT2[/dev/phone]: <-- OK 2004-03-28 01:04:34 [5] DEBUG: AT2[/dev/phone]: --> AT&F^M 2004-03-28 01:04:34 [5] DEBUG: AT2[/dev/phone]: <-- OK 2004-03-28 01:04:34 [5] DEBUG: AT2[/dev/phone]: --> ATE0^M 2004-03-28 01:04:34 [5] DEBUG: AT2[/dev/phone]: <-- ATE0 2004-03-28 01:04:34 [5] DEBUG: AT2[/dev/phone]: <-- OK 2004-03-28 01:04:34 [5] DEBUG: AT2[/dev/phone]: --> AT+IFC=2,2^M 2004-03-28 01:04:34 [5] DEBUG: AT2[/dev/phone]: <-- ERROR
(Since we disabled HW handshake, init fails and rolls back to no HW handshake)
2004-03-28 01:04:34 [5] INFO: AT2[/dev/phone]: cannot enable hardware handshake
2004-03-28 01:04:34 [5] DEBUG: AT2[/dev/phone]: --> AT+CPIN?^M
2004-03-28 01:04:34 [5] DEBUG: AT2[/dev/phone]: <-- +CPIN: READY
2004-03-28 01:04:34 [5] DEBUG: AT2[/dev/phone]: <-- OK
2004-03-28 01:04:34 [5] DEBUG: AT2[/dev/phone]: --> AT+CMGF=0^M
2004-03-28 01:04:34 [5] DEBUG: AT2[/dev/phone]: <-- OK
2004-03-28 01:04:34 [5] DEBUG: AT2[/dev/phone]: --> AT+CSMS=?^M
2004-03-28 01:04:34 [5] DEBUG: AT2[/dev/phone]: <-- +CSMS: (0,1)
2004-03-28 01:04:34 [5] DEBUG: AT2[/dev/phone]: <-- OK
2004-03-28 01:04:34 [5] INFO: AT2[/dev/phone]: Phase 2+ is supported
2004-03-28 01:04:34 [5] DEBUG: AT2[/dev/phone]: --> AT+CSMS=1^M
2004-03-28 01:04:34 [5] DEBUG: AT2[/dev/phone]: <-- +CSMS: 1,1,1
2004-03-28 01:04:34 [5] DEBUG: AT2[/dev/phone]: <-- OK
(We had to tweak the default AT+CNMI=1,2,0,1,0 to something Siemens like. It seems to need one less number)
2004-03-28 01:04:34 [5] DEBUG: AT2[/dev/phone]: --> AT+CNMI=1,2,0,0^M 2004-03-28 01:04:35 [5] DEBUG: AT2[/dev/phone]: <-- OK 2004-03-28 01:04:35 [5] INFO: AT2[/dev/phone]: AT SMSC successfully opened.
So it seems the problem is HW handshake.
As you see, I also had to tweak the init string. Here is my modems.conf Siemens group:
group = modems id = siemens_c60 name = "Siemens C60" init-string = "AT+CNMI=1,2,0,0" need-sleep = true
The question is: Is there any easy way (not patching the source code and recompiling) to disable HW handshake at startup?
Thank you in advance,
At 13:27 27/03/2004, you wrote:
My idea was that you to compare kannels device setup with ZTerms....
Don't you have the kannel source code ?
I append the settings from smsc_at2.c
/ Hakan
tios.c_iflag |= IGNBRK; /* ignore break & parity errors */ tios.c_iflag &= ~INPCK; /* INPCK: disable parity check */ tios.c_cflag |= HUPCL; /* hangup on close */ tios.c_cflag |= CREAD; /* enable receiver */ tios.c_cflag &= ~CSIZE; /* set to 8 bit */ tios.c_cflag |= CS8; tios.c_oflag &= ~ONLCR; /* no NL to CR-NL mapping outgoing */ tios.c_iflag |= IGNPAR; /* ignore parity */ tios.c_iflag &= ~INPCK; tios.c_cflag |= CRTSCTS; /* enable hardware flow control */ tios.c_cc[VSUSP] = 0; /* otherwhise we can not send CTRL Z */
/ Hakan
Alejandro Guerrieri wrote:
Yep, I've got stty. I�ve read the whole man page and assumed I have to use is like this:
# stty -f /dev/phone speed 9600 baud; lflags: -icanon -isig -iexten -echo iflags: -icrnl -ixon -ixany -imaxbel -brkint oflags: -opost -onlcr -oxtabs cflags: cs8 -parenb crtscts
I also tried with "stty -f /dev/tty.Palladio\ USB\ DataCable002" (The real device, not the symlink) and got exactly the same results, as expected.
To be honest, I'm somewhat fluent on regular terminal settings (line speed, parity, data bits, stop bits, flow control) but I don�t even hava a clue about the 10ths of options stty allows me to set. I don't know how kannel sets the connection, if it expects for the line being setupbefore or if sets all the parameters internally.
What I did with ZTerm was to connect to the device and send some AT commands. The phone responded and reacted as expected (returned "OK" on AT, AT&F, ATE0, and dialed out whith AT123456), so it seems the cable is working.
Mac OS X is heavily based on BSD, so you would expect a somewhat similar behaviour.
Thank you for your insights.
At 07:41 27/03/2004, you wrote:
Hi,
I don't know Mac OSX but errorcode #35 often means the write failed because all the written characters
don't fit in the alloated buffer. This can in turn indicate that all signals expeced on the cable not is there.
I don't know ZTerm (or kannel SMS-handling) but my guess is the ZTerm does set up the device
to ignore some missing signals.You can check this out with the command stty if it is avaiable on OSX
/ Hakan
Alejandro Guerrieri wrote:
Hi All,
I am trying to connect my Siemens C60 as a SMSC on Kannel 1.2.1
I am using a Palladio USB Datacable to connect the phone to the Mac.
I am using Kannel 1.2.1 compiled on Mac OSX.
I�ve tried the phone with a couple of Mac OSX softwares and it seems to work ok (I�ve sent SMS and downloaded my address book). I connected to the phone using ZTerm (A serial terminal emulator for Mac) and it responded to my "AT" commands flawlessly, it even dialed out, so it seems the hardware is working.
But, when I try to connect using kannel, I get connection errores. The "AT" commands seems to return empty.
I've tried using the "at" and the "at2" smsc, changing the modem models on "at" (siemens, nokiaphone, etc).
I've tried changing the serial line speed.
I've tried changing the device. My cable originally placed a device named "/dev/tty.Palladio USB DataCable002", so I�ve tried:
device = "/dev/tty.Palladio USB DataCable002"
device = /dev/tty.Palladio USB DataCable002
device = /dev/tty.Palladio\ USB\ DataCable002
and even made a symlink from /dev/tty.Palladio USB DataCable002 to /dev/phone to check if it was a problem related to the file's containing spaces.
I received somewhat similar errors each time.
Here is some logfile data:
Using AT2:
2004-03-27 03:59:02 [0] DEBUG: AT2[/dev/phone]: start called
2004-03-27 03:59:02 [6] DEBUG: sms_router: list_len = 0
2004-03-27 03:59:03 [5] DEBUG: AT2[/dev/phone]: device opened
2004-03-27 03:59:03 [5] INFO: AT2[/dev/phone]: speed set to 9600
2004-03-27 03:59:03 [5] DEBUG: AT2[/dev/phone]: --> ^M
2004-03-27 03:59:05 [5] DEBUG: AT2[/dev/phone]: write failed with errno 35
2004-03-27 03:59:06 [4] DEBUG: Started thread 7 (gw/bb_boxc.c:function)
2004-03-27 03:59:06 [7] INFO: Client connected from <127.0.0.1>
2004-03-27 03:59:06 [7] DEBUG: Started thread 8 (gw/bb_boxc.c:boxc_sender)
2004-03-27 03:59:07 [5] DEBUG: AT2[/dev/phone]: --> AT^M
2004-03-27 03:59:10 [5] DEBUG: AT2[/dev/phone]: write failed with errno 35
2004-03-27 03:59:14 [5] DEBUG: AT2[/dev/phone]: --> AT&F^M
2004-03-27 03:59:17 [5] DEBUG: AT2[/dev/phone]: write failed with errno 35
2004-03-27 03:59:21 [5] DEBUG: Thread 5 (gw/smsc/smsc_at2.c:at2_device_thread) terminates.
Using AT with nokiaphone:
2004-03-27 03:59:29 [0] DEBUG: Started thread 4 (gw/bb_boxc.c:smsboxc_run)
2004-03-27 03:59:30 [0] DEBUG: AT: Command: AT
2004-03-27 03:59:32 [4] DEBUG: Started thread 5 (gw/bb_boxc.c:function)
2004-03-27 03:59:32 [5] INFO: Client connected from <127.0.0.1>
2004-03-27 03:59:32 [5] DEBUG: Started thread 6 (gw/bb_boxc.c:boxc_sender)
2004-03-27 03:59:41 [0] DEBUG: Read from modem: ''
2004-03-27 03:59:41 [0] DEBUG: AT: Command: AT&F
2004-03-27 03:59:51 [0] DEBUG: Read from modem: ''
2004-03-27 03:59:51 [0] DEBUG: AT: Command: AT
2004-03-27 04:00:01 [0] DEBUG: Read from modem: ''
2004-03-27 04:00:01 [0] DEBUG: AT: Command: ATE0
2004-03-27 04:00:11 [0] DEBUG: Read from modem: ''
2004-03-27 04:00:11 [0] ERROR: Failed to create Smsc wrapper
2004-03-27 04:00:11 [0] PANIC: Cannot start with SMSC connection failing
Any hints?
Thank you in advance, -- Alejandro Guerrieri Magicom [EMAIL PROTECTED]
-- Alejandro Guerrieri Magicom [EMAIL PROTECTED]
-- Alejandro Guerrieri Magicom [EMAIL PROTECTED]
-- Alejandro Guerrieri Magicom [EMAIL PROTECTED]
