Skip to content

Instantly share code, notes, and snippets.

@saveriogzz
Last active May 17, 2022 13:12
Show Gist options
  • Save saveriogzz/b3fb4388f53aef0bd1e438a617351a36 to your computer and use it in GitHub Desktop.
Save saveriogzz/b3fb4388f53aef0bd1e438a617351a36 to your computer and use it in GitHub Desktop.
Parsivel serial commands

Parsivel commands

parsivel_telegram_command = 'CS/RA\r'  # Asks the Parsivel to read out all fields
parsivel_request_field_61 = 'CS/R/61\r'  # Asks the Parsivel to read out field 61
parsivel_request_field_90 = 'CS/R/91\r'  # Asks the Parsivel to read out field 61
parsivel_command_list = 'CS/?\r'  # Reads out a list of serial commands for the Parsivel.
parsivel_ott_telegram = 'CS/M/M/0\r'  # The Parsivel broadcasts the OTT telegram.
parsivel_telegram_start = 'CS/*/D/0\r'  # The Parsivel broadcasts the OTT telegram.
parsivel_user_telegram = 'CS/M/M/1\r'  # The Parsivel broadcasts the user defined telegram.
parsivel_set_telegram_list = 'CS/M/S/%01;%02;%03;%04;%05;%06;%07;%08;%09;%10;%11;%12;%13;%14;%15;%16;%17;%18;%19;%20;%21;%22;%23;%24;%25;%26;%27;%28;%30;%31;%32;%33;%34;%35;%60;%90;%91;%93\r'  # Defines which fields are in the telegram
parsivel_current_configuration = 'CS/L\r'  # Outputs current configuration
parsivel_impulse_mode = 'CS/I/60\r'  # Turns poll mode off and sets interval to 60sec
parsivel_set_time = 'CS/T/' + time.strftime("%H:%M:%S") + '\r'  # Sets the time on the Parsivel to the time on the Pi
parsivel_set_date = 'CS/D/' + time.strftime("%d.%m.%Y") + '\r'  # Sets the date on the Parsivel to the date on the Pi
parsivel_set_name = 'CS/K/' + Parsivel_name + '\r'  # Sets the name of the Parsivel, maximum 10 characters
parsivel_set_ID = 'CS/J/' + Parsivel_ID + '\r'  # Sets the ID of the Parsivel, maximum 4 numerical characters
parsivel_reset_factory_settings = 'CS/F/1\r'  # Resets the Parsivel to factory settings.
parsivel_real_time = 'CS/U\r'
parsivel_set_real_time = 'CS/U/' + time.strftime("%d.%m.%Y ") + time.strftime("%H:%M:%S") + '\r'
parsivel_restart = 'CS/Z/1\r'

Startup commands

During our first startup, we might want to send the following commands defined above

  • parsivel_impulse_mode
  • parsivel_set_name (example "PAR003")
  • parsivel_set_ID (example "003")
  • parsivel_set_real_time (This is important to be UTC and not local time!!)
  • parsivel_set_telegram_list
  • parsivel_user_telegram # this tells the Parsivel to send the telegram list we have defined right above instead of the default one

Note that when sending the command parsivel_restart, the parsivel will restart and send out some bytes with information strings about its bootloader i.e.

b'BOOTLOADER PARSIVEL\r\n'
b'*** PARSIVEL 2 ***\r\n'
b'COPYRIGHT (C) 2019 \r\n'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment