Compare commits
	
		
			2 Commits
		
	
	
		
			e20b46f9c7
			...
			6846a17243
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| 6846a17243 | |||
| 769a16dae6 | 
							
								
								
									
										2
									
								
								.gitignore
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										2
									
								
								.gitignore
									
									
									
									
										vendored
									
									
								
							@@ -2,4 +2,4 @@ keys.py
 | 
				
			|||||||
*.pyc
 | 
					*.pyc
 | 
				
			||||||
.image-cache/
 | 
					.image-cache/
 | 
				
			||||||
test.png
 | 
					test.png
 | 
				
			||||||
*.j2
 | 
					wifi_networks.yml
 | 
				
			||||||
							
								
								
									
										8
									
								
								README
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										8
									
								
								README
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,8 @@
 | 
				
			|||||||
 | 
					# EINK PICTURE FRAME - displays images on a multi-color eink display
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					## Deployment
 | 
				
			||||||
 | 
					Run the ansible playbooks (`setup` once, `deploy` on each code update):
 | 
				
			||||||
 | 
					```
 | 
				
			||||||
 | 
					ansible-playbook deploy/setup.playbook.yml -i <ip of pi>
 | 
				
			||||||
 | 
					ansible-playbook deploy/deploy.playbook.yml -i <ip of pi>
 | 
				
			||||||
 | 
					```
 | 
				
			||||||
@@ -1,15 +1,21 @@
 | 
				
			|||||||
- name: Basic setup tasks for Raspberry Pi
 | 
					- name: Deployment of software + requirements
 | 
				
			||||||
  hosts: all
 | 
					  hosts: all
 | 
				
			||||||
  user: remy
 | 
					  user: remy
 | 
				
			||||||
  become: true
 | 
					  become: true
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  tasks:
 | 
					  tasks:
 | 
				
			||||||
    - name: Add local ssh key
 | 
					    # DONE BY RPI IMAGER
 | 
				
			||||||
      ansible.posix.authorized_key:
 | 
					    # - name: Add local ssh key
 | 
				
			||||||
        user: "{{ ansible_user }}"
 | 
					    #   ansible.posix.authorized_key:
 | 
				
			||||||
        state: present
 | 
					    #     user: "{{ ansible_user }}"
 | 
				
			||||||
        # copy file present on the controller to the remote host
 | 
					    #     state: present
 | 
				
			||||||
        key: "{{ lookup('file', '~/.ssh/default.pub') }}"
 | 
					    #     # copy file present on the controller to the remote host
 | 
				
			||||||
 | 
					    #     key: "{{ lookup('file', '~/.ssh/default.pub') }}"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    - name: Include network variables
 | 
				
			||||||
 | 
					      ansible.builtin.include_vars:
 | 
				
			||||||
 | 
					        file: wifi_networks.yml
 | 
				
			||||||
 | 
					        name: wifi_external
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    - name: apt update all packages
 | 
					    - name: apt update all packages
 | 
				
			||||||
      apt:
 | 
					      apt:
 | 
				
			||||||
@@ -52,10 +58,20 @@
 | 
				
			|||||||
        delay: 5
 | 
					        delay: 5
 | 
				
			||||||
        timeout: 300
 | 
					        timeout: 300
 | 
				
			||||||
      
 | 
					      
 | 
				
			||||||
    - name: Add wifi networks from template
 | 
					    # - name: Add wifi networks from template
 | 
				
			||||||
      template:
 | 
					    #   template:
 | 
				
			||||||
        src: templates/wpa_supplicant.conf.j2
 | 
					    #     src: templates/wpa_supplicant.conf.j2
 | 
				
			||||||
        dest: /etc/wpa_supplicant/wpa_supplicant.conf
 | 
					    #     dest: /etc/wpa_supplicant/wpa_supplicant.conf
 | 
				
			||||||
        owner: root
 | 
					    #     owner: root
 | 
				
			||||||
        group: root
 | 
					    #     group: root
 | 
				
			||||||
        mode: 0600
 | 
					    #     mode: 0600
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    - name: Use raspi-config to set WIFI country
 | 
				
			||||||
 | 
					      shell: |
 | 
				
			||||||
 | 
					        raspi-config nonint do_wifi_country CH
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    - name: Use raspi-config to set WIFI SSID and password
 | 
				
			||||||
 | 
					      shell: |
 | 
				
			||||||
 | 
					        raspi-config nonint do_wifi_ssid_passphrase "{{ item.ssid }}" "{{ item.password }}"
 | 
				
			||||||
 | 
					      loop: "{{ wifi_external.networks }}"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -3,9 +3,8 @@ Description=Show new photo onto the eink display
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
[Service]
 | 
					[Service]
 | 
				
			||||||
Type=oneshot
 | 
					Type=oneshot
 | 
				
			||||||
 | 
					User={{ ansible_user }}
 | 
				
			||||||
WorkingDirectory={{ code_dest }}
 | 
					WorkingDirectory={{ code_dest }}
 | 
				
			||||||
 | 
					 | 
				
			||||||
ExecStart=python main.py
 | 
					ExecStart=python main.py
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -24,6 +24,7 @@ class ImageShow:
 | 
				
			|||||||
        if image.size != (self.epd.width, self.epd.height) and image.size != (self.epd.height, self.epd.width):
 | 
					        if image.size != (self.epd.width, self.epd.height) and image.size != (self.epd.height, self.epd.width):
 | 
				
			||||||
            raise ImageShowError("Image does not match screen size")
 | 
					            raise ImageShowError("Image does not match screen size")
 | 
				
			||||||
        elif image.size == (self.epd.height, self.epd.width):
 | 
					        elif image.size == (self.epd.height, self.epd.width):
 | 
				
			||||||
 | 
					            print("Rotated image to match orientation")
 | 
				
			||||||
            image = image.transpose(Image.ROTATE_270)
 | 
					            image = image.transpose(Image.ROTATE_270)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        self.__init__()
 | 
					        self.__init__()
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user