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

Committer:
olympux
Date:
Thu Oct 02 19:41:38 2014 +0000
Revision:
16:84a5bf7285d0
Parent:
15:edeb0aed160d
Child:
17:88ef7a078095
Added DBG.; Checked auto transmit flag.

Who changed what in which revision?

UserRevisionLine numberNew contents of line
olympux 9:d2534ecf88c6 1 CONFIGURATION SECTION (UDP)
olympux 9:d2534ecf88c6 2 1. DISCOVERY Command
olympux 9:d2534ecf88c6 3 + UDP broadcast: 192.168.0.255 to port 11000
olympux 9:d2534ecf88c6 4 + Send: NNIODS
olympux 9:d2534ecf88c6 5 + Receive: IP address
olympux 9:d2534ecf88c6 6
olympux 9:d2534ecf88c6 7 2. TCP SERVER PORT Command
olympux 9:d2534ecf88c6 8 + Send: NNIOTP
olympux 9:d2534ecf88c6 9 + Receive: 10000
olympux 9:d2534ecf88c6 10
olympux 9:d2534ecf88c6 11 3. UDP SERVER PORT Command
olympux 9:d2534ecf88c6 12 + Send: NNIOUP
olympux 9:d2534ecf88c6 13 + Receive: 11000
olympux 10:4cd965d79de0 14
olympux 10:4cd965d79de0 15 4. Set time using NTP Command
olympux 10:4cd965d79de0 16 + Send NNIOTM
olympux 10:4cd965d79de0 17 + Receive:
olympux 10:4cd965d79de0 18 DIS: if NTP is disabled
olympux 10:4cd965d79de0 19 ERR: if cannot update time
olympux 10:4cd965d79de0 20 Successful: Fri Sep 26 20:28:01 2014 {0A}
olympux 10:4cd965d79de0 21
olympux 10:4cd965d79de0 22 5. Set new network configuration
olympux 9:d2534ecf88c6 23 + Send: 19 bytes in total, NNIO + 15-byte
olympux 15:edeb0aed160d 24 NNIO 4-byte IP address 4-byte subnet 4-byte gateway 3-byte MAC
olympux 15:edeb0aed160d 25 4E 4E 49 4F C0 A8 00 78 FF FF FF 00 C0 A8 00 01 00 00 01
olympux 9:d2534ecf88c6 26
olympux 15:edeb0aed160d 27 6. Set TCP server info (only when the device is as a TCP client)
olympux 15:edeb0aed160d 28 + Send: 12 bytes in total, NNIO + 8 bytes
olympux 15:edeb0aed160d 29 NNIO 1-byte auto flag 1-byte time period (s) 4-byte IP 2-byte port (LSB MSB)
olympux 16:84a5bf7285d0 30 4E 4E 49 4F 'Y' or others 05 (5s) C0 A8 00 09 E0 2E (0x2EE0 = 12000)
olympux 10:4cd965d79de0 31
olympux 10:4cd965d79de0 32
olympux 9:d2534ecf88c6 33 INTERFACING SECTION (TCP)
olympux 9:d2534ecf88c6 34 4. Receiving Protocol: 58-bytes in total
olympux 11:709f90a3b599 35 Ex in hex
olympux 11:709f90a3b599 36 ID: 4E 4E 49 4F
olympux 11:709f90a3b599 37 OP: 4F 4F 4F 4F 51
olympux 11:709f90a3b599 38 IP: C0 A8 00 78
olympux 11:709f90a3b599 39 DO: 48 48 48 48 48 48 48 48
olympux 15:edeb0aed160d 40 AO: 80 00 80 00 (no DAC)
olympux 11:709f90a3b599 41 UART: 32-byte
olympux 11:709f90a3b599 42 CR: 0D
olympux 11:709f90a3b599 43
olympux 9:d2534ecf88c6 44 + Field ID (4-bytes) = NNIO
olympux 9:d2534ecf88c6 45 + Field OP (5-bytes): output control enable flag
olympux 9:d2534ecf88c6 46 Byte 1: Digital output
olympux 9:d2534ecf88c6 47 Byte 2: Analog output 0
olympux 9:d2534ecf88c6 48 Byte 3: Analog output 1
olympux 9:d2534ecf88c6 49 Byte 4: UART output
olympux 9:d2534ecf88c6 50 Byte 5: Command (Q: query status)
olympux 9:d2534ecf88c6 51 'O': enable controlling output
olympux 9:d2534ecf88c6 52 Others: disable controlling output
olympux 9:d2534ecf88c6 53 If Command is 'Q', device will update its outputs if needed and send its status including new outputs
olympux 9:d2534ecf88c6 54 + Field IP (4-bytes): device IP address
olympux 9:d2534ecf88c6 55 + Field DO[n] (8-bytes): digital output values
olympux 9:d2534ecf88c6 56 'H': output set to high
olympux 9:d2534ecf88c6 57 'L': output set to low
olympux 9:d2534ecf88c6 58 + Field AO_0 (2-bytes): 16-bit analog output value, channel 0
olympux 15:edeb0aed160d 59 no DAC
olympux 9:d2534ecf88c6 60 + Field AO_1 (2-bytes): 16-bit analog output value, channel 1
olympux 15:edeb0aed160d 61 no DAC
olympux 9:d2534ecf88c6 62 + UART output (32-bytes): max 32 bytes, stop string by NULL
olympux 9:d2534ecf88c6 63 + End char: CR
olympux 9:d2534ecf88c6 64
olympux 9:d2534ecf88c6 65 5. Sending Protocol: 39-bytes in total
olympux 9:d2534ecf88c6 66 + Field ID (4-bytes) = NNIO
olympux 9:d2534ecf88c6 67 + Field MAC (6-bytes)
olympux 9:d2534ecf88c6 68 + Field IP (4-bytes)
olympux 9:d2534ecf88c6 69 + Field DI[n]: 8-bit digital input values
olympux 9:d2534ecf88c6 70 'H' if input is HIGH
olympux 9:d2534ecf88c6 71 'L' if input is LOW
olympux 9:d2534ecf88c6 72 + Field DO[n]: 8-bit digital output values
olympux 9:d2534ecf88c6 73 'H' if output is HIGH
olympux 9:d2534ecf88c6 74 'L' if output is LOW
olympux 15:edeb0aed160d 75 + Field AI_0 (2-bytes): analog 16-bit input value, normalised, channel 0
olympux 15:edeb0aed160d 76 1st byte = LSB, 2nd byte = MSB
olympux 15:edeb0aed160d 77 + Field AI_1 (2-bytes): analog 16-bit input value, normalised, channel 1
olympux 15:edeb0aed160d 78 1st byte = LSB, 2nd byte = MSB
olympux 9:d2534ecf88c6 79 + Field AO_0 (2-bytes): 16-bit analog output value, channel 0
olympux 15:edeb0aed160d 80 no DAC, fixed
olympux 9:d2534ecf88c6 81 + Field AO_1 (2-bytes): 16-bit analog output value, channel 1
olympux 15:edeb0aed160d 82 no DAC, fixed
olympux 9:d2534ecf88c6 83 + End char: CR
olympux 9:d2534ecf88c6 84
olympux 9:d2534ecf88c6 85 6 Commands:
olympux 9:d2534ecf88c6 86 + QUERY STATUS ('Q')