Skip to content
 
 

Latest commit

 

History

35 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Improvement introduced in branch "montefusco"

Browser limitations on the number of WebSockets sessions allowed (per page)

During the initial deployment of TOA system on my home domotic system, I discovered a major drawback in the original code that makes it unusable even on small plants (at least when using the single page paradigm).

In fact, I created big pages (or tabbed pages), with much more controllers but only the first ten or twelve (browser depending) were working properly. So, it seems that there is a limitation in the number of WebSocket outgoing session per page allowed by the browser. In the end, I was forced to rewrite all the controllers (see js/controllers_s.js js/controllers_sd.js) in a way that they are creating one WebSocket connection for each class of controllers, instead of one for each instance. So the limitation is removed, as far as you are using less than ten type of different controllers in the same page.

Tasmota controller

As further improvement I wrote even a Tasmota specific controller (controllers_st_sd.js), needed in order to interface few Sonoff devices in my home network.

Tanzo Office Automation

Messaggi MQTT

toa/light
	id/setval			Set the brightness value (0,255)
	id/getval			Get the brightness value
	id/currentval		Send the brightness current value
	
toao/cm3panel
	{"cmd":pageload","value":"page.html"}	Change the CM3-panel web page
	{"cmd":videoload","value":"video.mp4"}	Load a background video
	{"cmd":clock_off"}						Hide clock
	{"cmd":clock_on"}						Show clock
	{"cmd":"message","value":"text"}		Send a message

Software to install on the CM3-Panel

sudo apt-get update
sudo apt-get install chromium-browser
sudo apt-get install xorg

Create the systemd file /lib/systemd/system/startx.service

[Unit]
Description=Launch xorg
After=systemd-user-sessions.service

[Service]
ExecStart=/usr/bin/xinit -bg black -fg white -geometry 132x36 -e "runuser pi -c 'chromium-browser --incognito  -kiosk --window-position=0,0 --window-size=800,480 http://www.tanzolab.it/panel'"
Restart=on-abort
User=root
WorkingDirectory=/home/pi

[Install]
WantedBy=multi-user.target

Software to install on the CM3-Home

NodeJS

bash <(curl -sL https://raw.githubusercontent.com/node-red/raspbian-deb-package/master/resources/update-nodejs-and-nodered)

About

Tanzo Office Automation

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages