Hello,
I have a problem with connecting to a http server.
The http server is a cross compiled legacy app which is locally running on the FX30 CAT M.
I could reach the http server via SSH commands like “wget” or “curl”.
I adapted the “httpGet” sample to execute curl commands to reach the http server on the localhost. Unfortunately I always get the error message “curl_easy_perform() failed: Couldn’t connect to server”.
The application is unsandboxed and the http server is listening to the port which I proved with the command “netstat -ln | grep -PORT”.
Does somebody have an idea what the problem could be?
i tried on curl console command, no problem is found:
root@swi-mdm9x28-wp:~# app start wifiWebAp
root@swi-mdm9x28-wp:~#
root@swi-mdm9x28-wp:~# ping 127.0.0.1
PING 127.0.0.1 (127.0.0.1): 56 data bytes
64 bytes from 127.0.0.1: seq=0 ttl=64 time=0.886 ms
64 bytes from 127.0.0.1: seq=1 ttl=64 time=0.791 ms
^C
— 127.0.0.1 ping statistics —
2 packets transmitted, 2 packets received, 0% packet loss
round-trip min/avg/max = 0.791/0.838/0.886 ms
root@swi-mdm9x28-wp:~# curl http://127.0.0.1:8080
<title>Legato - WiFi</title>
<noscript>
<h1>
Javascript seems to be disabled.
Please activate it in order to have this page fully functional.
</h1>
<style>html{display:none;}</style>
</noscript>
Setup of WiFi Access Point |
---|
<table id="config">
<tr>
<td witdh="50%">
<h2>General configuration</h2>
<p>
SSID: <input type="text" name="SSID" value="wifiWebApSSID" required>
</p>
<p>
Max Number of Clients:
<select name="maxclients" id="maxclients">
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
<option value="4">4</option>
<option selected="selected" value="5">5</option>
<option value="6">6</option>
<option value="7">7</option>
<option value="8">8</option>
<option value="9">9</option>
<option value="10">10</option>
</select>
</p>
<p>
Channel:
<select name="channel" id="channel">
<option selected="selected" value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
<option value="4">4</option>
<option value="5">5</option>
<option value="6">6</option>
<option value="7">7</option>
<option value="8">8</option>
<option value="9">9</option>
<option value="10">10</option>
<option value="11">11</option>
<option value="12">12</option>
<option value="13">13</option>
</select>
</p>
<p>
Visible:
<input type="radio" name="apvisible" value="1" checked> Yes
<input type="radio" name="apvisible" value="0" > No </br>
</p>
</td>
<td witdh="50%">
<h2>Security</h2>
<p>
Encryption:
<input type="radio" class="security" name="secu" value="1" onclick="toggleSecurity(this, 'key')" checked> WPA2
<input type="radio" class="security" name="secu" value="0" onclick="toggleSecurity(this, 'key')" > None
</br>
</p>
<p>
Set PassPhrase or PSK (Pre Shared Key):
<input type="radio" class="key" name="keyType" value="passphrase" checked> Passphrase
<input type="radio" class="key" name="keyType" value="psk" > PSK </br>
</br>
Passphrase or PSK: <input type="text" class="key" name="keyValue" id="keyValue" value="passphrase" required>
</br>
</p>
</td>
</tr>
<tr>
<td witdh="50%">
<h2>AP IPv4 range</h2>
<input type="checkbox" class="ipSetup" name="autoSetup" value="0" onclick="toggleAutoIPSetup(this, 'ipSetupCtrl'); toggleAutoIPSetup(this, 'ipSetupField');">Automatic setup</br>
<table style="margin:auto">
<tr class="ip">
</br>
<label><span class="notice">NOTICE: The 192.168.2.0/24 subnetwork is reserved and must not be used.</span></label>
</tr>
<tr class="ip">
<td class="ip"><label>AP IP-address</label></td>
<td class="ip"><input class="ipSetupField" name="ipAP" id="ipAP" size="15" maxlength="15" value="192.168.20.1" type="text" onchange="checkIPValue(this.id)" required></td>
<td class="ip"><input class="ipSetupCtrl" name="ipSetupButton" value=" Reset " onclick="resetAPIPRange('ipAP')" type="button"></td>
</tr>
<tr class="ip">
<td class="ip"><label>AP IP-netmask</label></td>
<td class="ip"><input class="ipSetupField" name="ipMask" id="ipMask" size="15" maxlength="15" value="255.255.255.0" type="text" onchange="checkIPMask(this.id)" required></td>
<td class="ip"><input class="ipSetupCtrl" name="ipSetupButton" value=" Reset " onclick="resetAPIPRange('ipMask')" type="button"></td>
</tr>
<tr class="ip">
<td class="ip"><label>Start IP-address</label></td>
<td class="ip"><input class="ipSetupField" name="ipStart" id="ipStart" size="15" maxlength="15" value="192.168.20.10" type="text" onchange="checkIPValue(this.id)" required></td>
<td class="ip"><input class="ipSetupCtrl" name="ipSetupButton" value=" Reset " onclick="resetAPIPRange('ipStart')" type="button"></td>
</tr>
<tr class="ip">
<td class="ip"><label>Stop IP-address</label></td>
<td class="ip"><input class="ipSetupField" name="ipStop" id="ipStop" size="15" maxlength="15" value="192.168.20.100" type="text" onchange="checkIPValue(this.id)" required></td>
<td class="ip"><input class="ipSetupCtrl" name="ipSetupButton" value=" Reset " onclick="resetAPIPRange('ipStop')" type="button"></td>
</tr>
</table>
</td>
<td witdh="50%">
<h2>Information</h2>
<iframe src="cgi-bin/hardinfo" width="100%" height="210px" frameborder="0"></iframe>
</td>
</tr>
</table>
<br /><br />
Via SSH Terminal it’s also possible for me to connect to the server:
The code of the curl command in the application is the following one:
The result is:
no problem is found on my side with WP76 Fw13.3.
You can use my app attached here.
http_get_WP76.zip (3.2 MB)
before running the application, you can start the http server by “app start wifiWebAp”
Thanks, but also your app is not working on the device. I started the app “wifiWebAp” and adapted your app to my target platform: WP77 R9.1.
Same result:
can you try the same FW as mine?
As I’m still using the developer studio the last available fw I can use is R11, but it’s also not working with that one.
I have no idea why it is not working on WP77 FW R9.1 or R12…
As a workaround, I tried on WP77 R9.1, we can use the following instead of 127.0.01 in httpGet.c
static const char * Url = “http://192.168.2.2:8080”;