Didier Wiroth <dwir...@gmail.com> writes: ... > Mar 5 22:43:01 406334G chat[9395]: send (ATZ^M) > Mar 5 22:43:01 406334G chat[9395]: expect (OK) > Mar 5 22:43:01 406334G chat[9395]: TZ^M^M > Mar 5 22:43:01 406334G chat[9395]: ERROR^M ... > Unfortunately these AT commands are chinese to me, ...
Wow, people don't know modems anymore. Here is a fair description of the hayes command set: http://en.wikipedia.org/wiki/Hayes_command_set You should definitely experiment. Use tip. Just because the company went bust doesn't mean you should leave this to the chinese. You should pay particular attention to how the AT command prefix operates, the use of +++, and on-hook vs. off-hook oeration. You might also care about S registers and dial strings, but those vary. If this were a real modem I'd suggest listening to the speaker too. The time & temperature lady used to be a good choice for this. The general problem you want to solve is: given any state this device might be in when you connect, get to a known state, then get it to whatever final state. So, some states the device might be in: online connected offline connected offline idle offline connected, at issued offline idle, at issued (and if you want to be particular, offline 'a' issued is also a state.) the stuff you had in your chat script (and other parts of the hayes command set) is supposed to deal with various cases, so, some common choices, (1 second delay)+++(1 second delay) if the modem is online, go offline. (you'll need to include a delay, and you'll have to suppress the trailing cr to make this work with chat.) \rATZ\r if the modem had previously gotten an at prefix, issue a null command. then reset the modem, which will hang up, and restore initial settings. In the case of your ERROR message - probably something had previously managed to issue AT but hadn't sent a trailing \r. -Marcus Watts