AT cmds for Mirage Talon from MangoH Red board AT port

  1. did you shutdown the firewall by
    iptables -I INPUT -j ACCEPT

  2. you should run the app by
    app runProc atServerIntegrationTest --exe=atServerTest -- socket

  3. the port 1235 is not for ssh, if you see the source code , it just opens the port 1235 for TCP server and accepts the client to enter AT command through TCP data

For testing socket, this is what was executed.

  1. shutdown firewall and another command, which was given in the atServerTest.c file
    root@swi-mdm9x28-wp:/tmp# iptables -S
    -P INPUT DROP
    -P FORWARD DROP
    -P OUTPUT ACCEPT
    -A INPUT -i lo -j ACCEPT
    -A INPUT -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT
    -A INPUT -p udp -m udp --sport 53 -j ACCEPT
    -A INPUT -p icmp -m icmp --icmp-type 0 -j ACCEPT
    -A INPUT -i ecm0 -p tcp -m tcp --dport 22 -j ACCEPT
    -A INPUT -i ecm0 -p icmp -m icmp --icmp-type 8 -j ACCEPT
    -A INPUT -i ecm0 -p udp -m udp --sport 67:68 --dport 67:68 -j ACCEPT
    -A INPUT -i bridge0 -p tcp -m tcp --dport 22 -j ACCEPT
    -A INPUT -i bridge0 -p icmp -m icmp --icmp-type 8 -j ACCEPT
    -A INPUT -i bridge0 -p udp -m udp --sport 67:68 --dport 67:68 -j ACCEPT
    root@swi-mdm9x28-wp:/tmp# iptables -I INPUT -j ACCEPT
    root@swi-mdm9x28-wp:/tmp#

  2. Running app using runProc
    root@swi-mdm9x28-wp:/tmp# app runProc atServerIntegrationTest --exe=atServerTest – socket

  3. As per the steps given in the atServerTest.c file, below, tried to access using ssh.
    It is mentioned used putty / ssh client. also mentioned use target IP.
    " * 2) Open a SSH client (e.g: putty) and configure it as below:

  • connection type: Raw, Host Name: IP address of target, port: 1235, In Terminal tab: “local echo”
  • and “local line editing” to be “force off”.
    1. Enter any AT commands that are registered in atServerTest.c file on putty terminal.
    1. Press ^C to stop the application.
    1. Delete the previously added rule: iptables -D INPUT -j ACCEPT "

But the above did not work.
Let me know for any corrections here

didn’t it say the connection type is RAW in putty?
So I don’t believe it is SSH connection.

After few trials, got a c app able to connect with the atServer app running on MangoH Red board from Android.

We got a custom board, with below iamge.

root@swi-mdm9x28-wp:~# cm info
Device: WP7607
IMEI: 359779080351204
IMEISV: 5
FSN: V3021585950810
Firmware Version: SWI9X07Y_02.18.05.00 000000 je 350.781610] i2c-msm-v2 78b8000.i2c: NACK: slave not responding, ensure its powe0
ns 2018/07/19 17:40:21
Bootloader Version: SWI9X07Y_02.18.05.00 000000 jenkins 2018/07/19 17:40:21
MCU Version: 002.009
PRI Part Number (PN): 9908663
PRI Revision: 001.002
Carrier PRI Name: GENERIC
Carrier PRI Revision: 002.041_002
SKU: 1104192
Last Reset Cause: Power Down, User requested
Resets Count: Expected: 178 Unexpected: 2
root@swi-mdm9x28-wp:~#

On this, when we try to execute “/sbin/udhcpc -R -b -i wlan0” using atSErver applciation, i get this error path,

user.err Legato: =ERR= | atServerStart[909] | /usr/share/udhcpc/default.script:
user.err Legato: =ERR= | atServerStart[909] | exec:
user.err Legato: =ERR= | atServerStart[909] | line 3:
user.err Legato: =ERR= | atServerStart[909] | run-parts: not found
user.err Legato: =ERR= | atServerStart[909] |

Can you give your inputs here.

I dont find this issue with MangoH red board

Didn’t you have same problem before and solve it later?

My bad, yes , thought the IP was obtained after adding a userdefined default.script.

But when i type ifconfig wlan0 no ip is obtained

I remember that you can do it previously…

Yes, but ifconfig wlan0 does not have any ip when i use userdefined default.script.I

Is there any env variables to be set? bcoz, the run-parts is not found from “/usr/share/udhcpc/default.script” file.

how did you make it work previously?
can you compare with your working environment in mangoh red board?

Thats the problem.

In MangoH red board, it worked with the below commands added to the atServer app.

wifi client start
wifi client scan
wifi client setsecurityproto <Ref: got from previous scan> 3
wifi client setpassphrase <Ref: got from previous scan> Home@123
wifi client connect <Ref: got from previous scan>
/sbin/udhcpc -R -b -i wlan0

But in the wp custom board with the same atServer app, for udhcpc, i get this error. Image SWI9X07Y_02.18.05.00 000000

are they in same FW as mangoh red board?
Is it OK to type in UART console of your custom board?
(not sure if you need to swiflash to recover the module to default state)

Custom board does not have the same firmware as MangoHRed board.
We chose to have the default one on the Custom WP board.

What i observed was the env paths are not set in the Custom WP board when atServer app is running.

In the Custom board, PATH = /legato/systems/current/appsWriteable/atServerWifiSocket/usr/bin
/legato/systems/current/appsWriteable/atServerWifiSocket/bin
/legato/bin,

But in evk ********PATH=’/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin:/legato/systems/current/appsWriteable/atServerWifiSocket/bin:/legato/systems/current/appsWriteable/atServerWifiSocket/usr/b
Jan 6 05:35:06 swi-mdm9x28-wp user.info Legato: INFO | atServerStart[872] | t/usr/local/bin’ *****************

On the WP atServer app, i did try to set the PATH, using the below but did not work.

printf(“BEFORE PATH= %s\n”, getenv(“PATH”));
system("export PATH=/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin:$PATH ");
printf(“AFTER PATH= %s\n”, getenv(“PATH”));

Image
CUSTOM Board :
root@swi-mdm9x28-wp:~# cm info
Device: WP7607
IMEI: 359779080351204
IMEISV: 5
FSN: V3021585950810
Firmware Version: SWI9X07Y_02.18.05.00 000000 jenki[ 329.424793] i2c-msm-v2 78b8000.i2c: NACK: slave not responding, ensure its 0
ns 2018/07/19 17:40:21
Bootloader Version: SWI9X07Y_02.18.05.00 000000 jenkins 2018/07/19 17:40:21
MCU Version: 002.009
PRI Part Number (PN): 9908663
PRI Revision: 001.002
Carrier PRI Name: GENERIC
Carrier PRI Revision: 002.041_002
SKU: 1104192
Last Reset Cause: Power Down, User requested
Resets Count: Expected: 187 Unexpected: 3

EVK :
root@swi-mdm9x28-wp:~# cm info
Device: WP7608
IMEI: 352913090102888
IMEISV: 6
FSN: XG814285460710
Firmware Version: SWI9X07Y_02.28.03.03 000000 jenkins 2019/05/21 03:33:04
Bootloader Version: SWI9X07Y_02.28.03.03 000000 jenkins 2019/05/21 03:33:04
MCU Version: 002.011
PRI Part Number (PN): 9907762
PRI Revision: 001.002
Carrier PRI Name: GENERIC
Carrier PRI Revision: 002.068_000
SKU: 1103788
Last Reset Cause: Power Down
Resets Count: Expected: 391 Unexpected: 28
root@swi-mdm9x28-wp:~#

Then please use the same FW to test

Can you confirm if SWI9X07Y_02.28.03.03 is FW 12 ?
Also the custom board has
Linux version 3.18.44 (jenkins@jenkins) (gcc version 6.2.0 (GCC) ) #2 PREEMPT Thu Sep 20 16:20:02 UTC 2018

while the MangoH red baord has
Linux version 3.18.131 (oe-user@oe-host) (gcc version 7.3.0 (GCC) ) #1 PREEMPT Tue May 21 06:09:42 UTC 2019

Does this effect ?

You can check the information in source.sierrawirelss.com.

https://source.sierrawireless.com/resources/airprime/software/wp76xx/wp76xx-firmware-release-12/#sthash.RnNZbSrp.s6zOB3lU.dpbs

Thanks!!

Concern is we have less units and dont want to mess flashing.

Even with fw 12, the issue exists.
Had to include the below code in atServer app before calling udhcp command.

char env_path[512];
sprintf(env_path,"/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin:%s",getenv("PATH"));
setenv("PATH", env_path, true );
printf("AFTER PATH= %s\n", getenv("PATH"));

It worked after that.

to me, this is not making sense to explain why it works on mangoh red board.

Even i have no clue, but after running this on custom board, it works for me

MangoH Red board i did not have to do any thing.

One information is needed here.

For the atServer socket app to run on WP, we need to run “iptables -I INPUT -j ACCEPT” before trying to access the socket app.

I did try to add this after bootup, about 20 secs in a starup app, but that still does not run.

Does iptables also have something like the ifconfig ?

Below is the code for reference. But still does not work.

COMPONENT_INIT
{
int i;
LE_INFO(" *************** atServerStart *********************** “);
sleep(10);
system(”/sbin/ifconfig ecm0 192.168.2.2");
LE_INFO(“atServerStart setting for ifconfig done \n”);
sleep(5);
system("/legato/systems/current/bin/app runProc atServerWifiSocket --exe=atServerTest – socket");
LE_INFO(“atServerStart finished running atServerWifiStart runProc \n”);
sleep(10);
for(i = 0; i <= 100 ; i++){
system("/usr/sbin/iptables -I INPUT -j ACCEPT");
sleep(5);
}
LE_INFO(“Set IP tables Finished \n”);
}
~