Tried to switch a led on and of through rpc but IP adress stays unchanged and the url to write the led gives a httpserver error

Dependencies:   EthernetInterface HTTPServer mbed-rpc mbed-rtos mbed

Files at this revision

API Documentation at this revision

Comitter:
Frostworks
Date:
Fri Apr 14 13:47:37 2017 +0000
Commit message:
I tried to switch a led on and off with rcp for mbed frdm k64f, it does compile but it doesn't change the ip to 192.168.1.101 and both the weburl http://192.168.1.101/rpc/led2/write0 and; http://192.168.1.27/rpc/led2/write1 give an httpserver error

Changed in this revision

EthernetInterface.lib Show annotated file Show diff for this revision Revisions of this file
HTTPServer.lib Show annotated file Show diff for this revision Revisions of this file
main.cpp Show annotated file Show diff for this revision Revisions of this file
mbed-rpc.lib Show annotated file Show diff for this revision Revisions of this file
mbed-rtos.lib Show annotated file Show diff for this revision Revisions of this file
mbed.bld Show annotated file Show diff for this revision Revisions of this file
diff -r 000000000000 -r c20da8fd007a EthernetInterface.lib
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/EthernetInterface.lib	Fri Apr 14 13:47:37 2017 +0000
@@ -0,0 +1,1 @@
+https://developer.mbed.org/users/Frostworks/code/EthernetInterface/#16def471e387
diff -r 000000000000 -r c20da8fd007a HTTPServer.lib
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/HTTPServer.lib	Fri Apr 14 13:47:37 2017 +0000
@@ -0,0 +1,1 @@
+http://developer.mbed.org/users/leihen/code/HTTPServer/#cc3f5c53d0d5
diff -r 000000000000 -r c20da8fd007a main.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Fri Apr 14 13:47:37 2017 +0000
@@ -0,0 +1,29 @@
+#include "mbed.h"
+#include "EthernetInterface.h"
+#include "HTTPServer.h"
+#include "mbed_rpc.h"
+#include "RpcHandler.h"
+
+RpcDigitalOut led2(LED2, "led2");   // define Rpc digital output object
+HTTPServer svr;         //  define HTTP server object
+EthernetInterface eth;  // create ethernet interface
+Serial pc(USBTX, USBRX);
+
+int main(){
+
+    pc.baud(115200);
+    pc.printf("does it work? ");
+    
+    RPC::add_rpc_class<RpcDigitalOut>();
+    eth.init("192.168.1.101"," 255.255.255.0"," 192.168.1.27");  // initialise interface with DCHP ("192.168.1.101"," 255.255.255.0"," 192.168.1.27")
+    eth.connect();      // connect and open communications
+    pc.printf("IP Address is %s\n", eth.getIPAddress());   // display IP address
+    svr.addHandler<HTTPRpcRequestHandler>("/rpc");  // add handler to server object
+    svr.start(80, &eth); // bind server to port 80
+    
+        while(1)
+        {
+            svr.poll(); // continuously poll for Ethernet messages to server
+        }
+}
+
diff -r 000000000000 -r c20da8fd007a mbed-rpc.lib
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed-rpc.lib	Fri Apr 14 13:47:37 2017 +0000
@@ -0,0 +1,1 @@
+https://mbed.org/users/mbed_official/code/mbed-rpc/#33e21ae4d434
diff -r 000000000000 -r c20da8fd007a mbed-rtos.lib
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed-rtos.lib	Fri Apr 14 13:47:37 2017 +0000
@@ -0,0 +1,1 @@
+https://mbed.org/users/mbed_official/code/mbed-rtos/#58563e6cba1e
diff -r 000000000000 -r c20da8fd007a mbed.bld
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Fri Apr 14 13:47:37 2017 +0000
@@ -0,0 +1,1 @@
+https://mbed.org/users/mbed_official/code/mbed/builds/97feb9bacc10
\ No newline at end of file