内网app显示在线,手机用4G就显示设备不在线-Arduino中文社区 - Powered by Discuz! Archiver

18038802360 发表于 2020-8-17 23:15

内网app显示在线,手机用4G就显示设备不在线

内网app显示在线(同在一个wifi下),手机用4G就显示设备不在线

奈何col 发表于 2020-8-18 00:02

看调试信息

18038802360 发表于 2020-8-18 16:58

6:57:25.285 -> ERROR: Print data is not Json! {"data":{"b1":{"swi":"off","ico":"far fa-lightbulb","clr":"#FF0000","tex":"日光模式开启"},"b2":{"swi":"off","ico":"far fa-lightbulb","clr":"#FF0000","tex":"夜光模式开启"},"b3":{"swi":"off","ico":"far fa-lightbulb","clr":"#FF0000","tex":"温馨模式开启"},"b4":{"swi":"off","ico":"far fa-lightbulb","clr":"#FF0000","tex":"电脑模式开启"},"b5":{"swi":"off","ico":"far fa-lightbulb","clr":"#FF0000","tex":"电视模式开启"},"b6":{"swi":"off","ico":"far fa-lightbulb","clr":"#FF0000","tex":"阅读模式开启"},"b7":{"swi":"off","clr":"#FF0000"}},"fromDevice":"6CE4F5666T3QL2KY7I3GMVFI","toDevice":"736542dcbc1e11ea9a655254","deviceType":"OwnApp"}

18038802360 发表于 2020-8-18 17:59

ERROR: Print data is not Json! {"data":{"state":"online","timer":"000","version":"0.1.0","b1":{"swi":"off","ico":"far fa-lightbulb","clr":"#FF0000","tex":"日光模式开启"},"b2":{"swi":"off","ico":"far fa-lightbulb","clr":"#FF0000","tex":"夜光模式开启"},"b3":{"swi":"off","ico":"far fa-lightbulb","clr":"#FF0000","tex":"温馨模式开启"},"b4":{"swi":"off","ico":"far fa-lightbulb","clr":"#FF0000","tex":"电脑模式开启"},"b5":{"swi":"off","ico":"far fa-lightbulb","clr":"#FF0000","tex":"电视模式开启"},"b6":{"swi":"off","ico":"far fa-lightbulb","clr":"#FF0000","tex":"阅读模式开启"},"humi":{"val":56.00,"clr":"#00DE00","uni":"%RH(舒适)"},"temp":{"val":34.90,"clr":"#DC143C","uni":"℃(炎热)"}},"fromDevice":"6CE4F5666T3QL2KY7I3GMVFI","toDevice":"736542dcbc1e11ea9a655254","deviceType":"OwnApp"}
请问这是什么问题:如果用内网WIFI可以,但用4G就报错!!!!!
void heartbeat()//心跳包使得我们每次打开APP都可以看到实时的最新湿度数据

{
   button_clear();   
   HUMI.print(humi_read);      
   TEMP.print(temp_read);   
}
void button_clear()
{
if (openState == 1){
Button1.text("日光模式关闭");
Button1.color("#00ffFF");
Button1.icon("far fa-lightbulb-on");
Button1.print("on");      //发送按键参数

Button2.print("off");
Button3.print("off");
Button4.print("off");
Button5.print("off");
Button6.print("off");
//Button7.print("off");
//Button8.print("off");
Button2.color("#FF0000");
Button3.color("#FF0000");
Button4.color("#FF0000");
Button5.color("#FF0000");
Button6.color("#FF0000");
//Button7.color("#FF0000");
   
}
else if (openState == 2)
{
Button2.text("夜光模式关闭");
Button2.icon("far fa-lightbulb-on");
Button2.color("#00ffFF");
Button2.print("on");      //发送按键参数   



Button1.print("off");
Button3.print("off");
Button4.print("off");
Button5.print("off");
Button6.print("off");
//Button7.print("off");
//Button8.print("off");
Button1.color("#FF0000");
Button3.color("#FF0000");
Button4.color("#FF0000");
Button5.color("#FF0000");
Button6.color("#FF0000");
// Button7.color("#FF0000");
   
}
else if (openState == 3)
{
Button3.text("温馨模式关闭");
Button3.icon("far fa-lightbulb-on");
Button3.color("#00ffFF");
Button3.print("on");      //发送按键参数

Button1.print("off");
Button2.print("off");
Button4.print("off");
Button5.print("off");
Button6.print("off");
//Button7.print("off");
//Button8.print("off");
Button1.color("#FF0000");
Button2.color("#FF0000");
Button4.color("#FF0000");
Button5.color("#FF0000");
Button6.color("#FF0000");
//Button7.color("#FF0000");
   
}

18038802360 发表于 2020-8-18 19:03

奈何col 发表于 2020-8-18 00:02
看调试信息

ERROR: Print data is not Json! {"data":{"state":"online","timer":"000","version":"0.1.0","b1":{"swi":"off","ico":"far fa-lightbulb","clr":"#FF0000","tex":"日光模式开启"},"b2":{"swi":"off","ico":"far fa-lightbulb","clr":"#FF0000","tex":"夜光模式开启"},"b3":{"swi":"off","ico":"far fa-lightbulb","clr":"#FF0000","tex":"温馨模式开启"},"b4":{"swi":"off","ico":"far fa-lightbulb","clr":"#FF0000","tex":"电脑模式开启"},"b5":{"swi":"off","ico":"far fa-lightbulb","clr":"#FF0000","tex":"电视模式开启"},"b6":{"swi":"off","ico":"far fa-lightbulb","clr":"#FF0000","tex":"阅读模式开启"},"humi":{"val":56.00,"clr":"#00DE00","uni":"%RH(舒适)"},"temp":{"val":34.90,"clr":"#DC143C","uni":"℃(炎热)"}},"fromDevice":"6CE4F5666T3QL2KY7I3GMVFI","toDevice":"736542dcbc1e11ea9a655254","deviceType":"OwnApp"}
请问这是什么问题:如果用内网WIFI可以,但用4G就报错!!!!!
void heartbeat()//心跳包使得我们每次打开APP都可以看到实时的最新湿度数据

{
   button_clear();   
   HUMI.print(humi_read);      
   TEMP.print(temp_read);   
}
void button_clear()
{
if (openState == 1){
Button1.text("日光模式关闭");
Button1.color("#00ffFF");
Button1.icon("far fa-lightbulb-on");
Button1.print("on");      //发送按键参数

Button2.print("off");
Button3.print("off");
Button4.print("off");
Button5.print("off");
Button6.print("off");
//Button7.print("off");
//Button8.print("off");
Button2.color("#FF0000");
Button3.color("#FF0000");
Button4.color("#FF0000");
Button5.color("#FF0000");
Button6.color("#FF0000");
//Button7.color("#FF0000");
   
}
else if (openState == 2)
{
Button2.text("夜光模式关闭");
Button2.icon("far fa-lightbulb-on");
Button2.color("#00ffFF");
Button2.print("on");      //发送按键参数   



Button1.print("off");
Button3.print("off");
Button4.print("off");
Button5.print("off");
Button6.print("off");
//Button7.print("off");
//Button8.print("off");
Button1.color("#FF0000");
Button3.color("#FF0000");
Button4.color("#FF0000");
Button5.color("#FF0000");
Button6.color("#FF0000");
// Button7.color("#FF0000");
   
}
else if (openState == 3)
{
Button3.text("温馨模式关闭");
Button3.icon("far fa-lightbulb-on");
Button3.color("#00ffFF");
Button3.print("on");      //发送按键参数

Button1.print("off");
Button2.print("off");
Button4.print("off");
Button5.print("off");
Button6.print("off");
//Button7.print("off");
//Button8.print("off");
Button1.color("#FF0000");
Button2.color("#FF0000");
Button4.color("#FF0000");
Button5.color("#FF0000");
Button6.color("#FF0000");
//Button7.color("#FF0000");
   
}

奈何col 发表于 2020-8-18 19:34

18038802360 发表于 2020-8-18 19:03
ERROR: Print data is not Json! {"data":{"state":"online","timer":"000","version":"0.1.0","b1":{"sw ...

确保你的blinker lib和8266 package都是最新

18038802360 发表于 2020-8-19 12:46

是esp32模块的

18038802360 发表于 2020-8-19 12:47

在你们官方链接下载的不知道是不是最新的
页: [1]
查看完整版本: 内网app显示在线,手机用4G就显示设备不在线