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:
Sat Oct 04 20:25:45 2014 +0000
Revision:
17:88ef7a078095
Parent:
16:84a5bf7285d0
Child:
18:ca499a2e7da6
Modify DISCOVERY command. Added IP, NetMask, GW query commands

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