响应远程访问 GNURadio 的 Unet 代理
Response to Remote access to Unet Agents for GNURadio
我想知道 Unetstack agent
对在 ip:port 处建立到调制解调器的 TCP connection
的响应是什么?
我试图通过 GNURadio pdu socket 使用 TCP connection
连接到调制解调器。连接已建立,但我认为在握手后,它会自动终止。它期待什么吗?我正计划使用此 API 将自定义消息发送到调制解调器。
这是我到目前为止所做的。
- 我使用下面的流程图使用
Socket PDU
块打开了一个 TCP connection
。
- 我使用unet audio SDOAM进行测试:
jay@jay-MS-7885:~/Desktop/unet-3.2.0$ bin/unet -c audio
Modem web: http://localhost:8080/
> iface
tcp://10.0.3.1:1100, tcp://192.168.0.14:1100, tcp://192.168.0.165:1100 [API]
ws://10.0.3.1:8080/ws, ws://192.168.0.14:8080/ws, ws://192.168.0.165:8080/ws [API]
unetsh: console://- [GroovyScriptEngine]
websh: ws://127.0.1.1:8080/fjage/shell/ws [GroovyScriptEngine]
看起来连接已建立,在 command prompt
的 GNURadio
端,我从调制解调器获得正常 JSON response
。就在该连接自动关闭之后。它期待什么吗?
Executing: /usr/bin/python3 -u /home/jay/Desktop/Jay/UnetstackPython.py
******* MESSAGE DEBUG PRINT ********
Send
************************************
******* MESSAGE DEBUG PRINT ********
(() . #[{ " a l i v e " : t r u e }
])
************************************
******* MESSAGE DEBUG PRINT ********
(() . #[{ " a c t i o n " : " s e n d " , " m e s s a g e " : { " c l a z z " : " o r g . a r l . f j a g e . G e n e r i c M e s s a g e " , " d a t a " : { " m s g I D " : " 0 9 f 5 3 2 0 0 - e 2 9 1 - 4 8 2 6 - 8 9 6 b - c 5 d 1 6 5 8 9 f 8 d 5 " , " i n R e p l y T o " : " 3 5 5 8 f e c 9 4 e e 7 b e e 1 a 5 0 f 5 6 6 1 d e 6 f c 4 b d " , " p e r f " : " A G R E E " , " r e c i p i e n t " : " W e b G W - c e a 1 9 a 9 d 3 7 f b e b 0 8 " , " s e n d e r " : " w e b s h " , " a n s " : " a u t o " } } , " r e l a y " : f a l s e }
])
************************************
******* MESSAGE DEBUG PRINT ********
(() . #[{ " a c t i o n " : " s e n d " , " m e s s a g e " : { " c l a z z " : " o r g . a r l . f j a g e . G e n e r i c M e s s a g e " , " d a t a " : { " m s g I D " : " 4 b d 5 6 f 0 7 - d a c 2 - 4 7 2 9 - 8 2 7 6 - b 4 4 1 8 6 d 3 1 6 a a " , " i n R e p l y T o " : " 8 7 7 9 5 2 4 c 4 5 d 8 9 f 1 e 4 6 3 b e 9 8 e 6 4 d 6 0 c e a " , " p e r f " : " A G R E E " , " r e c i p i e n t " : " W e b G W - c e a 1 9 a 9 d 3 7 f b e b 0 8 " , " s e n d e r " : " w e b s h " , " a n s " : " t c p : / / 1 0 . 0 . 3 . 1 : 1 1 0 0 , t c p : / / 1 9 2 . 1 6 8 . 0 . 1 4 : 1 1 0 0 , t c p : / / 1 9 2 . 1 6 8 . 0 . 1 6 5 : 1 1 0 0 [ A P I ] \ n w s : / / 1 0 . 0 . 3 . 1 : 8 0 8 0 / w s , w s : / / 1 9 2 . 1 6 8 . 0 . 1 4 : 8 0 8 0 / w s , w s : / / 1 9 2 . 1 6 8 . 0 . 1 6 5 : 8 0 8 0 / w s [ A P I ] \ n t c p : / / / 1 0 . 0 . 3 . 1 : 1 1 0 0 / / 1 0 . 0 . 3 . 1 . 3 5 9 5 6 [ A P I ] \ n u n e t s h : c o n s o l e : / / - [ G r o o v y S c r i p t E n g i n e ] \ n w e b s h : w s : / / 1 2 7 . 0 . 1 . 1 : 8 0 8 0 / f j a g e / s h e l l / w s [ G r o o v y S c r i p t E n g i n e ] " } } , " r e l a y " : f a l s e }
])
************************************
******* MESSAGE DEBUG PRINT ********
(() . #[{ " a c t i o n " : " s e n d " , " m e s s a g e " : { " c l a z z " : " o r g . a r l . f j a g e . p a r a m . P a r a m e t e r R s p " , " d a t a " : { " i n d e x " : - 1 , " v a l u e s " : n u l l , " p a r a m " : " o r g . a r l . y o d a . M o d e m P a r a m . n o i s e " , " v a l u e " : - 8 4 2 . 1 , " r e a d o n l y " : [ " o r g . a r l . y o d a . M o d e m P a r a m . n o i s e " ] , " m s g I D " : " c 4 6 8 b 2 8 c - 9 3 8 5 - 4 9 a 3 - 9 c 2 8 - a 8 6 5 e d 7 e 9 8 b c " , " p e r f " : " I N F O R M " , " r e c i p i e n t " : " W e b G W - c e a 1 9 a 9 d 3 7 f b e b 0 8 " , " s e n d e r " : " p h y " , " i n R e p l y T o " : " f 9 0 a 8 1 f 2 4 4 6 6 5 2 4 8 5 c a 7 3 1 b 0 7 a 5 6 1 e 9 3 " , " s e n t A t " : 1 6 1 5 4 2 0 6 8 6 4 3 0 } } , " r e l a y " : f a l s e }
])
************************************
******* MESSAGE DEBUG PRINT ********
(() . #[{ " a c t i o n " : " s e n d " , " m e s s a g e " : { " c l a z z " : " o r g . a r l . f j a g e . G e n e r i c M e s s a g e " , " d a t a " : { " m s g I D " : " e 2 1 2 4 c 9 c - 0 b 2 9 - 4 c 4 3 - 8 c 2 c - b 8 a d 2 3 8 c 4 1 8 a " , " i n R e p l y T o " : " 2 e 6 9 3 c b d 2 4 1 9 b 8 7 c b f a 9 c b 7 8 f 5 d 8 8 0 b f " , " p e r f " : " A G R E E " , " r e c i p i e n t " : " W e b G W - c e a 1 9 a 9 d 3 7 f b e b 0 8 " , " s e n d e r " : " w e b s h " , " a n s " : " a u t o " } } , " r e l a y " : f a l s e }
])
************************************
******* MESSAGE DEBUG PRINT ********
(() . #[{ " a c t i o n " : " s e n d " , " m e s s a g e " : { " c l a z z " : " o r g . a r l . f j a g e . G e n e r i c M e s s a g e " , " d a t a " : { " m s g I D " : " 1 e f f b 6 8 6 - a 0 5 a - 4 3 a d - a 5 a e - d 7 2 2 d 5 3 4 b b 1 9 " , " i n R e p l y T o " : " d 7 d e c 5 e b 6 a 2 3 d 6 8 3 d 6 8 2 7 3 6 2 c 8 4 d 0 2 8 f " , " p e r f " : " A G R E E " , " r e c i p i e n t " : " W e b G W - c e a 1 9 a 9 d 3 7 f b e b 0 8 " , " s e n d e r " : " w e b s h " , " a n s " : " t c p : / / 1 0 . 0 . 3 . 1 : 1 1 0 0 , t c p : / / 1 9 2 . 1 6 8 . 0 . 1 4 : 1 1 0 0 , t c p : / / 1 9 2 . 1 6 8 . 0 . 1 6 5 : 1 1 0 0 [ A P I ] \ n w s : / / 1 0 . 0 . 3 . 1 : 8 0 8 0 / w s , w s : / / 1 9 2 . 1 6 8 . 0 . 1 4 : 8 0 8 0 / w s , w s : / / 1 9 2 . 1 6 8 . 0 . 1 6 5 : 8 0 8 0 / w s [ A P I ] \ n t c p : / / / 1 0 . 0 . 3 . 1 : 1 1 0 0 / / 1 0 . 0 . 3 . 1 . 3 5 9 5 6 [ A P I ] \ n u n e t s h : c o n s o l e : / / - [ G r o o v y S c r i p t E n g i n e ] \ n w e b s h : w s : / / 1 2 7 . 0 . 1 . 1 : 8 0 8 0 / f j a g e / s h e l l / w s [ G r o o v y S c r i p t E n g i n e ] " } } , " r e l a y " : f a l s e }
])
************************************
******* MESSAGE DEBUG PRINT ********
(() . #[{ " a c t i o n " : " s e n d " , " m e s s a g e " : { " c l a z z " : " o r g . a r l . f j a g e . p a r a m . P a r a m e t e r R s p " , " d a t a " : { " i n d e x " : - 1 , " v a l u e s " : n u l l , " p a r a m " : " o r g . a r l . y o d a . M o d e m P a r a m . n o i s e " , " v a l u e " : - I n f i n i t y , " r e a d o n l y " : [ " o r g . a r l . y o d a . M o d e m P a r a m . n o i s e " ] , " m s g I D " : " f a b 5 e 8 4 8 - 4 6 7 6 - 4 1 4 9 - b 6 2 8 - 7 b b 5 a 4 8 2 a 0 f e " , " p e r f " : " I N F O R M " , " r e c i p i e n t " : " W e b G W - c e a 1 9 a 9 d 3 7 f b e b 0 8 " , " s e n d e r " : " p h y " , " i n R e p l y T o " : " a d a 8 d 2 7 1 2 3 6 e 8 d 5 6 0 f 1 7 d 2 9 7 9 e 5 0 2 0 7 4 " , " s e n t A t " : 1 6 1 5 4 2 0 6 8 9 4 3 1 } } , " r e l a y " : f a l s e }
])
************************************
terminate called after throwing an instance of 'boost::system::system_error'
what(): End of file
>>> Done (return code -6)
我正在尝试发送 JSON
消息,但在我做任何事情之前连接已关闭。
unetstack
是否需要特定的 JSON response
来保持连接活动?
UnetStack 使用的 JSON 协议来自 fjåge。协议的完整规范可以在这里找到:https://fjage.readthedocs.io/en/latest/protocol.html
协议期望在短超时(5 秒)内收到对 {"alive": true}
JSON 消息的确认。如果它没有收到确认,它将关闭连接,假设连接方没有响应。正确的确认是 {"alive": true}
发回以确认连接确实存在。
上述握手旨在满足其他传输方式(例如 RS232)的需求,其中断开连接只能通过连接通信来检测。
我想知道 Unetstack agent
对在 ip:port 处建立到调制解调器的 TCP connection
的响应是什么?
我试图通过 GNURadio pdu socket 使用 TCP connection
连接到调制解调器。连接已建立,但我认为在握手后,它会自动终止。它期待什么吗?我正计划使用此 API 将自定义消息发送到调制解调器。
这是我到目前为止所做的。
- 我使用下面的流程图使用
Socket PDU
块打开了一个TCP connection
。
- 我使用unet audio SDOAM进行测试:
jay@jay-MS-7885:~/Desktop/unet-3.2.0$ bin/unet -c audio
Modem web: http://localhost:8080/
> iface
tcp://10.0.3.1:1100, tcp://192.168.0.14:1100, tcp://192.168.0.165:1100 [API]
ws://10.0.3.1:8080/ws, ws://192.168.0.14:8080/ws, ws://192.168.0.165:8080/ws [API]
unetsh: console://- [GroovyScriptEngine]
websh: ws://127.0.1.1:8080/fjage/shell/ws [GroovyScriptEngine]
看起来连接已建立,在 command prompt
的 GNURadio
端,我从调制解调器获得正常 JSON response
。就在该连接自动关闭之后。它期待什么吗?
Executing: /usr/bin/python3 -u /home/jay/Desktop/Jay/UnetstackPython.py
******* MESSAGE DEBUG PRINT ********
Send
************************************
******* MESSAGE DEBUG PRINT ********
(() . #[{ " a l i v e " : t r u e }
])
************************************
******* MESSAGE DEBUG PRINT ********
(() . #[{ " a c t i o n " : " s e n d " , " m e s s a g e " : { " c l a z z " : " o r g . a r l . f j a g e . G e n e r i c M e s s a g e " , " d a t a " : { " m s g I D " : " 0 9 f 5 3 2 0 0 - e 2 9 1 - 4 8 2 6 - 8 9 6 b - c 5 d 1 6 5 8 9 f 8 d 5 " , " i n R e p l y T o " : " 3 5 5 8 f e c 9 4 e e 7 b e e 1 a 5 0 f 5 6 6 1 d e 6 f c 4 b d " , " p e r f " : " A G R E E " , " r e c i p i e n t " : " W e b G W - c e a 1 9 a 9 d 3 7 f b e b 0 8 " , " s e n d e r " : " w e b s h " , " a n s " : " a u t o " } } , " r e l a y " : f a l s e }
])
************************************
******* MESSAGE DEBUG PRINT ********
(() . #[{ " a c t i o n " : " s e n d " , " m e s s a g e " : { " c l a z z " : " o r g . a r l . f j a g e . G e n e r i c M e s s a g e " , " d a t a " : { " m s g I D " : " 4 b d 5 6 f 0 7 - d a c 2 - 4 7 2 9 - 8 2 7 6 - b 4 4 1 8 6 d 3 1 6 a a " , " i n R e p l y T o " : " 8 7 7 9 5 2 4 c 4 5 d 8 9 f 1 e 4 6 3 b e 9 8 e 6 4 d 6 0 c e a " , " p e r f " : " A G R E E " , " r e c i p i e n t " : " W e b G W - c e a 1 9 a 9 d 3 7 f b e b 0 8 " , " s e n d e r " : " w e b s h " , " a n s " : " t c p : / / 1 0 . 0 . 3 . 1 : 1 1 0 0 , t c p : / / 1 9 2 . 1 6 8 . 0 . 1 4 : 1 1 0 0 , t c p : / / 1 9 2 . 1 6 8 . 0 . 1 6 5 : 1 1 0 0 [ A P I ] \ n w s : / / 1 0 . 0 . 3 . 1 : 8 0 8 0 / w s , w s : / / 1 9 2 . 1 6 8 . 0 . 1 4 : 8 0 8 0 / w s , w s : / / 1 9 2 . 1 6 8 . 0 . 1 6 5 : 8 0 8 0 / w s [ A P I ] \ n t c p : / / / 1 0 . 0 . 3 . 1 : 1 1 0 0 / / 1 0 . 0 . 3 . 1 . 3 5 9 5 6 [ A P I ] \ n u n e t s h : c o n s o l e : / / - [ G r o o v y S c r i p t E n g i n e ] \ n w e b s h : w s : / / 1 2 7 . 0 . 1 . 1 : 8 0 8 0 / f j a g e / s h e l l / w s [ G r o o v y S c r i p t E n g i n e ] " } } , " r e l a y " : f a l s e }
])
************************************
******* MESSAGE DEBUG PRINT ********
(() . #[{ " a c t i o n " : " s e n d " , " m e s s a g e " : { " c l a z z " : " o r g . a r l . f j a g e . p a r a m . P a r a m e t e r R s p " , " d a t a " : { " i n d e x " : - 1 , " v a l u e s " : n u l l , " p a r a m " : " o r g . a r l . y o d a . M o d e m P a r a m . n o i s e " , " v a l u e " : - 8 4 2 . 1 , " r e a d o n l y " : [ " o r g . a r l . y o d a . M o d e m P a r a m . n o i s e " ] , " m s g I D " : " c 4 6 8 b 2 8 c - 9 3 8 5 - 4 9 a 3 - 9 c 2 8 - a 8 6 5 e d 7 e 9 8 b c " , " p e r f " : " I N F O R M " , " r e c i p i e n t " : " W e b G W - c e a 1 9 a 9 d 3 7 f b e b 0 8 " , " s e n d e r " : " p h y " , " i n R e p l y T o " : " f 9 0 a 8 1 f 2 4 4 6 6 5 2 4 8 5 c a 7 3 1 b 0 7 a 5 6 1 e 9 3 " , " s e n t A t " : 1 6 1 5 4 2 0 6 8 6 4 3 0 } } , " r e l a y " : f a l s e }
])
************************************
******* MESSAGE DEBUG PRINT ********
(() . #[{ " a c t i o n " : " s e n d " , " m e s s a g e " : { " c l a z z " : " o r g . a r l . f j a g e . G e n e r i c M e s s a g e " , " d a t a " : { " m s g I D " : " e 2 1 2 4 c 9 c - 0 b 2 9 - 4 c 4 3 - 8 c 2 c - b 8 a d 2 3 8 c 4 1 8 a " , " i n R e p l y T o " : " 2 e 6 9 3 c b d 2 4 1 9 b 8 7 c b f a 9 c b 7 8 f 5 d 8 8 0 b f " , " p e r f " : " A G R E E " , " r e c i p i e n t " : " W e b G W - c e a 1 9 a 9 d 3 7 f b e b 0 8 " , " s e n d e r " : " w e b s h " , " a n s " : " a u t o " } } , " r e l a y " : f a l s e }
])
************************************
******* MESSAGE DEBUG PRINT ********
(() . #[{ " a c t i o n " : " s e n d " , " m e s s a g e " : { " c l a z z " : " o r g . a r l . f j a g e . G e n e r i c M e s s a g e " , " d a t a " : { " m s g I D " : " 1 e f f b 6 8 6 - a 0 5 a - 4 3 a d - a 5 a e - d 7 2 2 d 5 3 4 b b 1 9 " , " i n R e p l y T o " : " d 7 d e c 5 e b 6 a 2 3 d 6 8 3 d 6 8 2 7 3 6 2 c 8 4 d 0 2 8 f " , " p e r f " : " A G R E E " , " r e c i p i e n t " : " W e b G W - c e a 1 9 a 9 d 3 7 f b e b 0 8 " , " s e n d e r " : " w e b s h " , " a n s " : " t c p : / / 1 0 . 0 . 3 . 1 : 1 1 0 0 , t c p : / / 1 9 2 . 1 6 8 . 0 . 1 4 : 1 1 0 0 , t c p : / / 1 9 2 . 1 6 8 . 0 . 1 6 5 : 1 1 0 0 [ A P I ] \ n w s : / / 1 0 . 0 . 3 . 1 : 8 0 8 0 / w s , w s : / / 1 9 2 . 1 6 8 . 0 . 1 4 : 8 0 8 0 / w s , w s : / / 1 9 2 . 1 6 8 . 0 . 1 6 5 : 8 0 8 0 / w s [ A P I ] \ n t c p : / / / 1 0 . 0 . 3 . 1 : 1 1 0 0 / / 1 0 . 0 . 3 . 1 . 3 5 9 5 6 [ A P I ] \ n u n e t s h : c o n s o l e : / / - [ G r o o v y S c r i p t E n g i n e ] \ n w e b s h : w s : / / 1 2 7 . 0 . 1 . 1 : 8 0 8 0 / f j a g e / s h e l l / w s [ G r o o v y S c r i p t E n g i n e ] " } } , " r e l a y " : f a l s e }
])
************************************
******* MESSAGE DEBUG PRINT ********
(() . #[{ " a c t i o n " : " s e n d " , " m e s s a g e " : { " c l a z z " : " o r g . a r l . f j a g e . p a r a m . P a r a m e t e r R s p " , " d a t a " : { " i n d e x " : - 1 , " v a l u e s " : n u l l , " p a r a m " : " o r g . a r l . y o d a . M o d e m P a r a m . n o i s e " , " v a l u e " : - I n f i n i t y , " r e a d o n l y " : [ " o r g . a r l . y o d a . M o d e m P a r a m . n o i s e " ] , " m s g I D " : " f a b 5 e 8 4 8 - 4 6 7 6 - 4 1 4 9 - b 6 2 8 - 7 b b 5 a 4 8 2 a 0 f e " , " p e r f " : " I N F O R M " , " r e c i p i e n t " : " W e b G W - c e a 1 9 a 9 d 3 7 f b e b 0 8 " , " s e n d e r " : " p h y " , " i n R e p l y T o " : " a d a 8 d 2 7 1 2 3 6 e 8 d 5 6 0 f 1 7 d 2 9 7 9 e 5 0 2 0 7 4 " , " s e n t A t " : 1 6 1 5 4 2 0 6 8 9 4 3 1 } } , " r e l a y " : f a l s e }
])
************************************
terminate called after throwing an instance of 'boost::system::system_error'
what(): End of file
>>> Done (return code -6)
我正在尝试发送 JSON
消息,但在我做任何事情之前连接已关闭。
unetstack
是否需要特定的 JSON response
来保持连接活动?
UnetStack 使用的 JSON 协议来自 fjåge。协议的完整规范可以在这里找到:https://fjage.readthedocs.io/en/latest/protocol.html
协议期望在短超时(5 秒)内收到对 {"alive": true}
JSON 消息的确认。如果它没有收到确认,它将关闭连接,假设连接方没有响应。正确的确认是 {"alive": true}
发回以确认连接确实存在。
上述握手旨在满足其他传输方式(例如 RS232)的需求,其中断开连接只能通过连接通信来检测。