Webserver only w/o any other functions, single thread. Running on STM32F013+W5500

Dependencies:   NTPClient W5500Interface Watchdog device_configuration eeprom_flash mbed-rpc-nucleo mbed-rtos mbed

Fork of F103-Serial-to-Ethernet by Chau Vo

protocol_rpc.txt

Committer:
olympux
Date:
2016-06-13
Revision:
38:f8735ae519aa
Parent:
35:f5c98e2d6aad

File content as of revision 38:f8735ae519aa:

NNIO module can be controlled through TCP/UDP using RPC commands.


1. Connections
  + UDP port: 11000
  + TCP port: 10000 (NNIO module is TCP server)

2. Digital inputs
  + Digital inputs: di0 - di7
  + Commands: /di0/read x
    
3. Digital outputs
  + Digital outputs: do0 - do7
  + Commands:
    /do0/read x
    /do0/write 1

3. Analog inputs
  + Analog inputs: ai0 - ai1
  + Commands:
    /ai0/read x: returns a value between 0 to 1
    /ai0/read_u16 x: returns a value between 0 to 0xFFFF

4. PWM outputs:
  + PWM outputs: pwm0 - pwm1
  + Commands:
    /pwm/period 0.5: Set the PWM period, specified in seconds (float), keeping the duty cycle the same.
    /pwm/period_ms 500: Set the PWM period, specified in milli-seconds (int), keeping the duty cycle the same.
    /pwm/pulsewidth 1: Set the PWM pulsewidth, specified in seconds (float), keeping the period the same.
    /pwm/pulsewidth_ms 1000: Set the PWM pulsewidth, specified in milli-seconds (int), keeping the period the same.
    /pwm/read x: Return the current output duty-cycle setting, measured as a percentage (float).
    /pwm/write 0.6: Set the ouput duty-cycle, specified as a percentage (float).

5. Timers:
  + Timer: timer1
  + Commands:
    /tmr1/start x
    /tmr1/stop x
    /tmr1/reset x
    /tmr1/read x: returns float, between 0 to 1.
    /tmr1/read_ms
    /tmr1/read_us

6. UARTs:
  + Uart: uart
  + Commands:
    /uart/baud 9600
    /uart/putc 60: send ASCII code, '<'
    /uart/getc x: return ASCII code
    /uart/puts helloworld: print helloworld to serial port
    
7. RPCVariable
  + Declare normal variables and associate them with RPCVariable, e.g. int wheels, float speed, char banner
  + Commands:
    /speed/write 34.5
    /speed/read x
    /wheels/write 64
    /wheels/read x
    /banner/write c
    /banner/read x
    
8. RPCFunction
  + Declare a function and associate it with RPCFunction
  + Commands:
    /func_name/run x