Skip to content
Snippets Groups Projects
README.md 2.79 KiB
Newer Older
  • Learn to ignore specific revisions
  • Jake Read's avatar
    Jake Read committed
    ## Vent Display
    
    ### Yonder Phy
    
    We have an RJ45 port, pinouts are 
    
    | pin | sig | 
    | --- | --- | 
    | 1 | SGND | 
    | 2 | TxD | 
    | 3 | RxD | 
    | 4 | CTS | 
    | 5 | RTS | 
    | 6 | SGND |
    
    Seems like this should be straightforward - datasheet notes that data is uni-directional, my guess is that it just spews data out of the port, wouldn't that be nice. 
    
    First move is to get it venting. [Setup Guide](https://bu.digication.com/bumc-ed1/ltv-ventilator-setup-and-initial-settings) 
    
    OK, have woken it up with a glove, can confirm it has an RS232 out that just spews data - that's great. I do need an RS232 interface though, which swings -10 to +10v here. 
    
    ### RPI
    
    pi  
    vent 
    
    - do rpi basic setup:
        - use mouse, keyboard, hdmi...
        - connect to internet, do updates 
    - install node.js 
        - `$ curl -sL https://deb.nodesource.com/setup_14.x | sudo -E bash -`
        - `$ sudo apt install -y nodejs`
    - install raspi-serial
        - have to do some serialport config stuff 
        - might be some trix in here: the bluetooth module uses the serialport, so we have to wrestle for control 
    - get vscode ? 
    
    I think we want RPI4 for this, they have decent UART support now.
    - https://learn.pi-supply.com/make/raspberry-pi-4-pinout/ 
    - https://datasheets.raspberrypi.org/bcm2711/bcm2711-peripherals.pdf 
    
    
    ## Log
    
    ## 2020 11 05 
    
    OK, turned the vent on today, and got characters from the RS232 port. Have an RPI setup and ready to test with some code tomorrow morning, and a temporary RS232-TTL adapter to splice in between. Some concern about the RPI's serial port being 'in use' when bluetooth module is being used, etc. RPI 4 has mucho ++ serial ports, will try to use one of those in the end run. 
    
    So, first move tomorrow is getting the serial port hooked up & seeing if I can pull anything into JS, then is a little software architecting. 
    
    ## 2020 11 06
    
    Serial on the RPI3 is a pain, have to disable a bunch of things:
    
    https://openenergymonitor.org/forum-archive/node/12311.html 
    
    OK, so I:
        - used node serialport (not the particular raspi-serial library)
        - set it up for /dev/ttyAMA0, the default port
        - baudrate to 60096 
        - use a bytelength parser 
        - disable the uart terminal / enable the uart hardware in `sudo raspi-config`
        - put `dtoverlay=pi3-disable-bt` in `/boot/config.txt`
        - did `sudo systemctl disable hciuart`
        - rebooted
        - now I am recieving bytes 
    
    So I should decode some packets. 
    
    Packets: decoded. Now I want the 'other end' of it, my bootstrap code / server / client. 
    
    Cool, have a bootstrap up, just need to plug it into the ltv, get three plots up and one state-swapping thing, then it should be ahn MVP, next step would be a circuit / display. 
    
    OK, I have the client / server architecture setup now... so just one more day at that and I should have an MVP, good enough to proceed with a circuit etc.