VFD from cash register with esphome

i got a display from a varipos 715 unit - 20x2 lines with a serial connection hacked into the output on the zt3232 chip on the board.

it uses pos7300 protocol, but i am unsure how to format the commands to the display.

i used a esp32 and made an uart on pin 17.

Did anyone play with the pos7300 protocol and esphome?




Can you post your code (formatted please)?

captive_portal:
    

uart:
  id: display
  tx_pin: GPIO17 
  #rx_pin: GPIO2  
  baud_rate: 9600
  data_bits: 8
  parity: NONE
  stop_bits: 1    
  debug:

switch:

  - platform: template
    name: “send”
    turn_on_action:
     - uart.write:
         id: display
         data: [0x1B,0x46,0x44,[adadsadsa],0x0D ] 

last line is wrong

pos7300 manual says :

ok. i have connection to the display and can now separately write text and commands to it, but how do i send this combined message to it: 1B 46 44 [text] 0D - seems that esphome can not accept the text part in the following: 0x1B, 0x46, 0x44, ´text´ ,0x0D

I don’t know what you mean with that. What’s the output if you send:
[0x1B, 0x46, 0x44, 0x68, 0x65, 0x6C, 0x6C, 0x6F, 0x0D]

Would an ASCII to HEX table assist, both in coding, as well as understanding the issue?

The desired bit/byte pattern actually transmitted to the pos7300 is the same, whether you depict it as text, or as an Hex value in your code. One is ASCII, the other HEX. Both represent the same character. Of course if your code demands it, you can translate from one to the other at whim, as required.
Hex codes are useful, often for escape sequences that don’t have an equivalent ASCII value, ASCII values being a smaller subset of the possible HEX values available.

Wait till you get to umlauts and the like - no wonder those French and Italians wave their arms about so expressively when they converse! Grins.

Not sure if that kind of string manipulation and concatenation works.

Hello. got it

thanks all for your help. made actions to send text to the display and learned a lot during this.

great stuff

    - action: scroll_line_1
      variables:
        message: string
      then:
        - uart.write:
            id: display
            data: [0x1B, 0x46, 0x44]  # scroll text horisontal line 1 start  
        - uart.write:
            id: display
            data: !lambda |
              std::string text = message;
              std::vector<uint8_t> data(text.begin(), text.end());
              return data;
        - uart.write:
            id: display
            data: [0x0d]  # scroll text horisontal line 1 stop
1 Like