Browse Source

Added msm_size and sdk_size to mDNS txts

fastled
Xose Pérez 7 years ago
parent
commit
faa8202045
3 changed files with 30 additions and 8 deletions
  1. +10
    -0
      code/espurna/mdns.ino
  2. +11
    -5
      code/ota_flash.sh
  3. +9
    -3
      code/ota_list.sh

+ 10
- 0
code/espurna/mdns.ino View File

@ -46,6 +46,16 @@ void mdnsSetup() {
MDNS.addServiceTxt("arduino", "tcp", "app_name", APP_NAME);
MDNS.addServiceTxt("arduino", "tcp", "app_version", APP_VERSION);
MDNS.addServiceTxt("arduino", "tcp", "target_board", DEVICE_NAME);
{
char buffer[6];
itoa(ESP.getFlashChipRealSize() / 1024, buffer, 10);
MDNS.addServiceTxt("arduino", "tcp", "mem_size", (const char *) buffer);
}
{
char buffer[6];
itoa(ESP.getFlashChipSize() / 1024, buffer, 10);
MDNS.addServiceTxt("arduino", "tcp", "sdk_size", (const char *) buffer);
}
_mdns_wifi_onSTA = WiFi.onStationModeGotIP([](WiFiEventStationModeGotIP ipInfo) {
_mdnsStart();


+ 11
- 5
code/ota_flash.sh View File

@ -22,14 +22,16 @@ echo_pad() {
useAvahi() {
echo_pad "#" 4
echo_pad "HOSTNAME" 20
echo_pad "IP" 20
echo_pad "HOSTNAME" 25
echo_pad "IP" 25
echo_pad "APP" 15
echo_pad "VERSION" 15
echo_pad "DEVICE" 30
echo_pad "MEM_SIZE" 10
echo_pad "SDK_SIZE" 10
echo
printf -v line '%*s\n' 104
printf -v line '%*s\n' 134
echo ${line// /-}
counter=0
@ -52,16 +54,20 @@ useAvahi() {
app_name=`echo $txt | sed -n "s/.*app_name=\([^\"]*\).*/\1/p"`
app_version=`echo $txt | sed -n "s/.*app_version=\([^\"]*\).*/\1/p"`
board=`echo $txt | sed -n "s/.*target_board=\([^\"]*\).*/\1/p"`
mem_size=`echo $txt | sed -n "s/.*mem_size=\([^\"]*\).*/\1/p"`
sdk_size=`echo $txt | sed -n "s/.*sdk_size=\([^\"]*\).*/\1/p"`
echo -n "$ip;" >> $ip_file
echo -n "$board;" >> $board_file
echo_pad "$counter" 4
echo_pad "$hostname" 20
echo_pad "$ip" 20
echo_pad "$hostname" 25
echo_pad "http://$ip" 25
echo_pad "$app_name" 15
echo_pad "$app_version" 15
echo_pad "$board" 30
echo_pad "$mem_size" 10
echo_pad "$sdk_size" 10
echo


+ 9
- 3
code/ota_list.sh View File

@ -14,14 +14,16 @@ echo_pad() {
useAvahi() {
echo_pad "#" 4
echo_pad "HOSTNAME" 20
echo_pad "HOSTNAME" 25
echo_pad "IP" 25
echo_pad "APP" 15
echo_pad "VERSION" 15
echo_pad "DEVICE" 30
echo_pad "MEM_SIZE" 10
echo_pad "SDK_SIZE" 10
echo
printf -v line '%*s\n' 104
printf -v line '%*s\n' 134
echo ${line// /-}
counter=0
@ -36,13 +38,17 @@ useAvahi() {
app_name=`echo $txt | sed -n "s/.*app_name=\([^\"]*\).*/\1/p"`
app_version=`echo $txt | sed -n "s/.*app_version=\([^\"]*\).*/\1/p"`
board=`echo $txt | sed -n "s/.*target_board=\([^\"]*\).*/\1/p"`
mem_size=`echo $txt | sed -n "s/.*mem_size=\([^\"]*\).*/\1/p"`
sdk_size=`echo $txt | sed -n "s/.*sdk_size=\([^\"]*\).*/\1/p"`
echo_pad "$counter" 4
echo_pad "$hostname" 20
echo_pad "$hostname" 25
echo_pad "http://$ip" 25
echo_pad "$app_name" 15
echo_pad "$app_version" 15
echo_pad "$board" 30
echo_pad "$mem_size" 10
echo_pad "$sdk_size" 10
echo
done


Loading…
Cancel
Save