Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

module load cesium - no data #1

Closed
Ryanf55 opened this issue Nov 9, 2024 · 3 comments · Fixed by #4
Closed

module load cesium - no data #1

Ryanf55 opened this issue Nov 9, 2024 · 3 comments · Fixed by #4
Labels
bug Something isn't working

Comments

@Ryanf55
Copy link
Collaborator

Ryanf55 commented Nov 9, 2024

When trying to load this as a mavproxy module, it doesn't get mavlink data.

It only works standalone.
https://github.com/ArduPilot/MAVCesium?tab=readme-ov-file#getting-it-running-standalone

The TCP socket seems to connect and disconnect sometimes, no data arrives.

@Ryanf55 Ryanf55 added the bug Something isn't working label Nov 9, 2024
@Ryanf55
Copy link
Collaborator Author

Ryanf55 commented Nov 12, 2024

Traceback (most recent call last):
  File "/home/ryan/Dev/ardu_ws/src/MAVProxy/MAVProxy/modules/mavproxy_link.py", line 1053, in master_callback
    mod.mavlink_packet(m)
  File "/home/ryan/Dev/ardu_ws/src/MAVProxy/MAVProxy/modules/mavproxy_cesium/__init__.py", line 193, in mavlink_packet
    if self.fence_change_time != self.module('fence').fenceloader.last_change:
AttributeError: 'FenceModule' object has no attribute 'fenceloader'

@Ryanf55
Copy link
Collaborator Author

Ryanf55 commented Nov 12, 2024

Once I changed to use the wploader object, I then ran into:

Root cause: Tornado update to v5 introduce changes in event loop handling. The proposed solution worked great!
tornadoweb/tornado#2308 (comment)

MANUAL> module load cesium
MANUAL> Using config file at /home/ryan/Dev/ardu_ws/src/MAVProxy/MAVProxy/modules/mavproxy_cesium/app/mavcesium_default.ini
Loaded module cesium
Starting Tornado server: http://0.0.0.0:5000/mavcesium/

MANUAL> websocket opened!
websocket opened!
Traceback (most recent call last):
  File "/home/ryan/Dev/ardu_ws/src/MAVProxy/MAVProxy/modules/mavproxy_link.py", line 1053, in master_callback
    mod.mavlink_packet(m)
  File "/home/ryan/Dev/ardu_ws/src/MAVProxy/MAVProxy/modules/mavproxy_cesium/__init__.py", line 181, in mavlink_packet
    self.send_data({'mav_data':msg_dict})
RuntimeError: There is no current event loop in thread 'main_loop'.

@Ryanf55
Copy link
Collaborator Author

Ryanf55 commented Nov 12, 2024

Actually, AnyThreadEventLoopPolicy is now deprecated.... These libraries change faster than I can keep up.

/home/ryan/Dev/ardu_ws/src/MAVProxy/MAVProxy/modules/mavproxy_cesium/app/cesium_web_server.py:170: DeprecationWarning: AnyThreadEventLoopPolicy is deprecated, use asyncio.run or asyncio.new_event_loop instead
  asyncio.set_event_loop_policy(tornado.platform.asyncio.AnyThreadEventLoopPolicy())

The docs say to use asyncio's base functions in tornado 6.
https://www.tornadoweb.org/en/stable/asyncio.html#module-tornado.platform.asyncio

Cesium is using tornado 6.4.1. I don't have much understanding of how these two interract.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant