AllSky7 Sensor Board Manual (Rev 1.1)

Components

The sensor board consists of the following hardware components:

  1. Raspberry Pi Pico RP2040-ETH micro-controller with CH9120 Ethernet chip and USB-C connector
  2. Internal temperature and humidity sensor
  3. buck converter 12V -> 5V
  4. GPS receiver
    Note: The GPS antenna must be attached the the receiver and mounted horizontally inside the dome with the sensor point on top. The sensor support different signals like GPS (USA), BEIDOU (China), GALILEO (EU), GLONASS (Russia) and QZSS (Japan)
  5. 12V power in
  6. 12V power out
  7. 5V power out
  8. Connector for external temperature and humidity sensor
  9. 3.3V power out
  10. relay add-on (optional)

Purpose

The purpose of the device is to determine certain parameters from inside the AllSky7 cameras:

In addition, the device provides different voltages and digital ports for further sensors. An optional relay can control additional hardware like heaters, coolers or fans based on the climate conditions inside and outside the dome. Note that the power consumption for heaters and coolers is too large to be provided by the camera itself. So you need to provide a separate power supply.

Mounting

The device is mounted below the zenith cameras. It is powered by 12V, and connected via an Ethernet cable to the Ethernet switch inside the camera dome.

Interface

The device has a static IP address 192.168.76.70. Communication is conducted via HTTP and can be initiated via curl, as in the following examples.

Configuration File

You can configure the device by uploading a configuration file.

Here is a sample configuration file.

# configuration file for AllSky7 Sensor Board
version,1.0
temp,0,5
hum,90,70
dewpoint,3,10
sensor,dp
led,on
sensorlog,1
debugdevice,usb
debuglevel,all

Everthing behind a hash sign (#) is regarded as remark and omitted. The following parameters can be configured:

When you install a heating device, the temperature for switching the relay on should be lower than the switch off temperature, or the humiditidy for switching it on should be higher than the switch off humidity. In case of a cooling device of fan, the values should be vice versa.

Sensor Data

Here is a typical JSON record which is returned from a get_sensor HTTP request:

{
"firmwareversion":"1.1",
"firmwaredate":"2024/12/22",
"hardwaretype":"Waveshare RP2040-ETH",
"intemperature":"37.6",
"inhumidity":"29",
"outtemperature":"22.7",
"outhumidity":"39",
"longitude":"12.631270",
"latitude":"52.494991",
"altitude":"39",
"direction":"38",
"velocity":"0.0",
"utcdate":"2024/12/25",
"utctime":"21:50:12.602",
"satellites":"6",
"hdop":"2.9",
"accuracy":"low"
}

Most of the attributes are self-explanatory. direction and velocity are measures from the GPS sensor in case the camera is moving. utcdate and utctime are the time when the get_sensor HTTP request was received by the decide, accurate to ~1ms. satellites are the number of satellites used for the GPS solution and hdop the horizontal dilution of precision, a measure of the quality of the signal. accuracy translates the hdop value to low, medium or high accuracy.

Monitoring and Logging

The micro-controller has 2MB of flash memory, half of which is used for the internal LittleFS file system. All sensor data will be written in regular, defined intervals to a local logfile. Note that only 1 MB of flash data is available. If every minute a log entry is written, the filesystem will be full in about 4 days. In order not to loose sensor data, you should regularly download the logfile, and purge it thereafter.
You can use the sensor data logfile to display the sensor value change over time and determine critical values, e.g. when the dome is fogging from the inside.
For debug purposes you can write certain device logdata into a local logfile, or to the Serial or Ethernet port. Note that sending debug outpout to the ethernet port will interfer with the output of other HTTP requests.
Depending of the status of the device, the LED on the micro-controller shows the following colors:

Firmware Upgrade

To upgrade the firmware, upload the new firmware file together with the file size and CRC32 fingerprint to the device with the corresponding HTTP command. If the upload was successful, you can execute the update, which takes less than a second, via the next command. If there are breaking changes in the format of the configuration file, you should format the filesystem beforehand.
The next image shows typical steps of a firware upgrade.

Alternatively, you can connect the device via USB and upload the new firmware via the file explorer.

Known Issues

Due to a problem with the provided Ethernet library, the HTTP data gets often corrupted during the transfer. This results in malformed requests or incomplete uploads and downloads. If your HTTP service request returns an error message, or if the CRC of the file upload is incorrect, just repeat the HTTP call until it is successful.
If you download logdata, calculate the CRC32 value of the file (e.g. with 7-ZIP: 7z.exe h < filename >) and compare it with the CRC value given in the return header.
Alternatively, if you upload a configuration file and want to make sure it is not getting corruped, add the CRC32 values to the HTML header. If it is not matching, try the download again.