WeChat-Based Remote Observatory Control Software Design Postprint
He Shousheng, Wang Chuanjun, Yufeng Fan, Yu Xiaoguang, Wang Deqing, Huang Yongping, Wang Jiankun
Submitted 2022-01-14 | ChinaXiv: chinaxiv-202201.00051

Abstract

Remote observatories offer advantages such as high observation efficiency and low operating costs, making remote observation applications increasingly widespread. The development of 5G network technology has enabled remote observation using mobile terminals such as smartphones, while advancements in Internet of Things and social network technologies have provided new avenues for data transmission, data sharing, and user-friendly operation. To implement remote observation for the 14-inch telescope at Yunnan Observatory and validate remote observatory technologies based on the Internet of Things and social networks, we independently designed and developed a remote observatory control software system that employs WeChat chat mode for sending and receiving control commands, utilizes WeChat image format for transmitting observation images, and adopts WeChat groups for managing user permissions, thereby achieving remote observation functionality via WeChat on mobile terminals such as smartphones. This work provides referable experience and methodology for the design of remote observatory control software and the application of social networks in astronomical observation.

Full Text

Design of Remote Observatory Control Software Based on WeChat

He Shousheng¹², Wang Chuanjun¹², Fan Yufeng¹², Yu Xiaoguang¹², Wang Deqing¹², Huang Yongping¹², Wang Jiankun¹

¹ Yunnan Observatories, Chinese Academy of Sciences, Kunming 650216, China
² Key Laboratory for the Structure and Evolution of Celestial Objects, Chinese Academy of Sciences, Kunming 650216, China
Email: heshousheng@ynao.ac.cn

Abstract

Remote observatories offer advantages such as high observation efficiency and low operational costs, making remote observation increasingly widespread. The development of 5G network technology has enabled remote observation via mobile terminals like smartphones, while advances in Internet of Things (IoT) and social network technologies provide new avenues for data transmission, sharing, and user-friendly operation. To realize remote observation for the 14-inch telescope at Yunnan Observatory and to validate remote observatory technologies based on IoT and social networks, we designed and developed a remote observatory control software. Using WeChat chat mode for sending/receiving control commands, WeChat image format for transmitting observation images, and WeChat groups for controlling user permissions, we implemented remote observation functionality for mobile terminals based on WeChat. This provides valuable experience and methodology for remote observatory control software design and the application of social networks in astronomical observation.

Keywords: Remote Observatory; Remote Observation; Social Network; WeChat

Remote Observatory (RO) represents the product of highly developed Internet and automation technologies, offering advantages such as high observation efficiency and low operational costs. Remote observation has become a mainstream trend in astronomical observation, playing an increasingly important role in astronomical research, site selection, and science education [1-3].

Recent developments in 5G network technology have significantly improved mobile network quality, making remote observation via smartphones and other mobile terminals feasible. The Kunming University of Science and Technology's Yunnan Provincial Key Laboratory of Computer Technology Applications has implemented monitoring and control of the RTS2 autonomous control system using HTTP protocol and WeChat mini-programs for JSON data interaction [4]; amateur astronomers also commonly use remote desktop software like Sunflower for remote observation. However, conventional computer-based remote observation modes are extremely inconvenient on mobile devices due to screen size limitations and other factors, and have certain limitations in real-time data transmission and sharing. Meanwhile, Internet of Things (IoT) [5] and Social Networks (SN) [6] technologies offer new opportunities: leveraging these technologies can further improve and enhance data transmission, sharing, and user-friendly operation functions for remote observation.

To achieve remote observation for the 14-inch telescope at Yunnan Observatory and simultaneously validate remote observatory technologies based on IoT and social networks, we designed a set of remote observatory control software based on WeChat. This paper primarily introduces its design methodology and actual measurement results.

1 System Architecture

The system architecture is shown in Figure 1. The Remote Observatory Server serves as the system core, together with astronomical instruments such as Dome/Roof, Telescope, Camera, Filter, Focuser, Rotator, and Observation Conditions monitoring systems to form the basic hardware system of the remote observatory. The remote observatory control software described herein is deployed on the remote observation server, responsible for controlling astronomical instruments to achieve observation functions on one hand, and for interacting with observation terminals to provide remote services on the other. The WeChat Server is Tencent's official server; observation terminals such as Mobile/Pad/PC communicate with the remote observation server via the WeChat client (or WeChat App).

Remote control based on WeChat typically employs two solutions: public accounts and mini-programs [7-8]. Public accounts have an IoT-specific solution called the WeChat Hardware Platform with more advanced device functions. Both public accounts and mini-programs share the following characteristics: First, based on a timeout communication mechanism, they are implemented by the WeChat client actively accessing the remote server, which lacks real-time performance. For time-consuming operations like camera exposure, technologies such as Ajax polling or WebSocket are required. Second, remote servers have high network requirements, typically needing a fixed URL (public IP) or relay through an independent server. In response to these characteristics, this paper adopts the WeChat chat mode to develop remote observatory control software. Compared with public accounts and mini-programs, this mode supports bidirectional communication, offers better real-time performance, and has lower network requirements.

2 Software Design

The software system was developed using object-oriented programming in C# under the Windows 10 operating system.

2.1 Software Architecture

The software was developed following a four-layer architecture, as shown in Figure 2. From bottom to top, the layers are the Device Driver Layer, Basic Control Layer, Advanced Control Layer, and Interface Layer. Classes were written layer by layer as shown in Table 1.

Table 1: Software Classes

Class Description Dome Dome/Roof control class Telescope Telescope control class Camera Camera control class Filter Filter wheel control class Focuser Focuser control class Rotator Rotator control class ObsCondition Observing conditions class OCS Observatory control system class LO Local observation class WeChat Remote observation class AO Autonomous observation class MainForm MainForm interface class Fits Fits image file class

The Device Driver Layer forms the foundation for controlling astronomical instruments, consisting of device classes such as Dome, Telescope, Camera, Filter, Focuser, Rotator, and ObsCondition. These respectively provide basic operation functions for instruments including the dome (or roof), telescope, camera, filter wheel, focuser, rotator, and site monitoring system. The Device Driver Layer supports the ASCOM protocol [9-10] while also supporting custom protocols based on serial port and network connections.

The Basic Control Layer implements fundamental functions of the observation control system. The OCS class directly calls basic functions from device classes in the Device Driver Layer, combining equipment operation logic to achieve specific observation functions. For example, dome shutter open/close operations must consider site observation conditions, dome tracking depends on telescope pointing and tracking parameters, and camera operations involve interrelationships with the status of the dome, telescope, filter wheel, and focuser.

The Advanced Control Layer implements high-level functions of the observation control system, combining local observation requirements, remote control interfaces, and autonomous observation algorithms to realize Local Observation (LO), Remote Observation (RO), and Autonomous Observation (AO). The WeChat class is the implementation class for remote observation based on WeChat.

The Interface Layer is the top-level framework of the software system, including multiple window interface classes such as MainForm, primarily used for system settings and advanced observation operations. In addition, the software system includes various functional classes such as the Fits image class for observation image generation, storage, and display.

2.2 Remote Interface

The remote observation function was developed using the WeChat PC version as the carrier, employing WeChat chat mode for sending/receiving control commands, WeChat image format for transmitting observation images, and WeChat groups for controlling user permissions. The WeChat control interface uses third-party open-source code wechat-bot (https://github.com/cixingguangming55555/wechat-bot).

The workflow is shown in Figure 3. First, observation conditions are judged based on data from the site monitoring system. If conditions are suitable, the system polls and reads WeChat messages. Then it determines whether the message sender is an authorized user (i.e., has control permissions). If the user has control permissions, the command is processed and corresponding observation control operations are performed, such as target pointing (goto), camera exposure (expose), and various device controls (dome, focuser, etc.). For camera exposure commands, upon completion, the observation image is actively sent to the corresponding WeChat user.

Table 2: Basic Remote Commands

Command Description dome o Dome operation: o-open/close/track/stop/park goto ra dec Goto target: ra-Right Ascension, dec-Declination park Park telescope expose F [t] [f] Expose: F-light/dark/bias/flat/abort, t-expose time, f-filter wheel name filter f Set Filter wheel: f-filter name/number focuser n Set Focuser steps: n-focuser steps rotator n Set Rotator angle: n-rotator angle state d Get device state: d-tele/came/filt/focu/rota/obsc

The simplest remote observation procedure is as follows: First, use the "dome open" command to open the dome shutter (or roof), and "dome track" command to enable dome tracking; then use the "goto" command to drive the telescope to point at the target; after the telescope is in tracking state, use the "expose" command (including filter parameters) to perform exposure operations to obtain observation images; use the "focuser" command if focusing is needed; after observation, use "dome close" to close the dome and "park" the telescope. To check current observation conditions, use the "state obsc" command to obtain site information.

User permission control is the security guarantee for remote observation. This system implements basic user permission control using WeChat group-based control, adding users or groups to be observed to the control user list, and the system automatically filters messages from users not in the control list. Advanced permission control functions can precisely assign control user permissions based on factors such as observation time, operation functions (e.g., observation control, data operations), and user groups, though this is not discussed in detail in this paper.

2.3 Actual Testing

Testing was conducted on the 14-inch RC telescope at Yunnan Observatory, selecting NGC 6530 as the observation target with a 600-second exposure in the B band. Figure 4 shows the local observation interface of the remote observation server, with the remote observatory control software main interface at the top, the PC WeChat client remote observation interface at the lower left, and the remote observatory control software control interface at the lower right. Figure 5 shows the remote observation interface based on the mobile WeChat App.

When the system runs, the remote observatory administrator first logs into the PC WeChat client using their WeChat account. The remote observatory control software connects to the WeChat client and selects the corresponding user or group to assign control permissions, then automatically enters remote observation mode. This paper uses group observation mode as an example, where observers perform remote observation operations via command line, the administrator is responsible for command processing and device control, and observation images are automatically sent to the observation group after completion. Actual test results demonstrate that the remote observatory control software works normally and meets basic software design requirements.

Compared with WeChat public account and mini-program modes, using WeChat chat mode for remote control has the following advantages: 1) Better real-time performance, easier implementation, without requiring Ajax, WebSocket, or other technologies; 2) Lower network threshold, no public IP needed, remote control can be conducted as long as WeChat chat is available; 3) More convenient data transmission and sharing, transmitting observation images via WeChat chat mode facilitates data sharing among observers; 4) Remote observation can simultaneously conduct normal voice and text communication in the observation group, allowing timely evaluation and adjustment of observation plans. However, this mode also has the following disadvantages: 1) Command-line operation without a graphical interface requires familiarity with operation commands, resulting in a relatively high user threshold; 2) Since the PC WeChat client uses QR code login mechanism, when the remote observation server starts up or reboots, remote login requires assistance from remote desktop software or specially written code to send the QR code to remote terminals.

In summary, this paper designed and developed a set of remote observatory control software based on WeChat, and conducted relevant tests on the 14-inch RC telescope at Yunnan Observatory, achieving the goal of validating remote observatory technologies based on IoT and social networks, and providing valuable experience and methodology for remote observatory control software design and the application of social networks in astronomical observation. However, remote observatory control software is a complex systems software engineering project; this design only implements some basic functions and methods, and requires continuous improvement and refinement in future work.

References

[1] Wang Chuanzhong, Su Liying, Han Jun, et al. Design and Realization of Remote Observatory Power Integrated Control and Monitoring Module [J]. Astronomical Research & Technology, 2020, 17(1): 104-110.

[2] Wei Shoulin, Cao Zihuang, Wang Feng, et al. A Study of Web Control of an RTS2 System Based on the WebSocket [J]. Astronomical Research & Technology, 2014, 11(4): 404-409.

[3] Ran Fanhui, Deng Hui, Liang Bo, et al. A Study of Remote Access Techniques for An RTS2 Autonomous Observation Software System Based on the XML-RPC [J]. Astronomical Research & Technology, 2013, 10(4): 372-377.

[4] Liang Bo, Tian Zhiyan, Wang Feng, et al. A Control Framework for RTS2 Based on the WeChat Micro-program [J]. Astronomical Research & Technology, 2018, 15(2): 202-207.

[5] Lin Yiqi, Li Lei, Jiang Yin, et al. The Application of the Internet of Thing Techniques on the Management of the Shenzhen Xichong Astronomy and Meteorology Comprehensive Exploration Base [J]. Science and Technology Innovation Herald, 2015, 12(25): 8-11.

[6] Zhang, Jiajin & Chen, Lichang & Cai, Xiaobo & Gao, Quan. (2015). iGreenhouse: A Case Study for Connecting Physical Devices into Mobile Social Networks. International Journal of Smart Home. 9. 163-172. 10.14257/ijsh.2015.9.6.18.

[7] Xiao Qijun, Wu Shihao, Zhen Jiedong, et al. Smart Home System Based on Public Account of Wechat [J]. Mechanical & Electrical Engineering Technology, 2020, 49(11): 58-60.

[8] Feng Ba, Li Xi, Tang Jian, et al. Design and Implementation of Remote Control Platform for Pure Electric Bus Based on WeChat Program [J]. The Journal of New Industrialization, 2020, 10(4): 98-103.

[9] Zhang Guanjun, Song Tengfei, Cheng Xiangming, et al. Automatic Control of Astronomical Dome Based on ASCOM and PLC [J]. Astronomical Research & Technology, 2020, 17(4): 548-554.

[10] Peng Yajie, Ji Kaifan, Liang Bo, et al. The Usability of the ASCOM in Remote Control of a Site-Survey Telescope [J]. Astronomical Research & Technology, 2013, 10(1): 49-54.

Funded by: National Natural Science Foundation of China (11773070); Yunnan Provincial Department of Science and Technology Science and Technology Entry into Yunnan Project (202003AD150003)

Submission history

WeChat-Based Remote Observatory Control Software Design Postprint