From f4c71012beb59fed80f5faa3094377f53b552c9c Mon Sep 17 00:00:00 2001 From: Gunstick Date: Fri, 13 Feb 2015 22:53:04 +0100 Subject: [PATCH] new displayclient for arduino with ethernet shield and neopixels format for central config file describing dynamically the setup moved some files around and adapted runitall / readme for the new layout --- README.md | 6 +- displayclient/ardupixel/README | 15 ++ displayclient/ardupixel/ardupixel.ino | 109 +++++++++++ .../ardupixel/serial2eeprom/serial2eeprom.ino | 183 ++++++++++++++++++ displayclient/{ => cpp-client}/AppWindow.cpp | 0 displayclient/{ => cpp-client}/AppWindow.h | 0 displayclient/{ => cpp-client}/Makefile | 0 displayclient/{ => cpp-client}/Renderer.cpp | 0 displayclient/{ => cpp-client}/Renderer.h | 0 displayclient/{ => cpp-client}/defines.h | 0 displayclient/{ => cpp-client}/main.cpp | 0 .../{ => cpp-client}/make_displayclient | 0 .../html}/README | 0 .../html}/building-isometric_b.jpg | Bin .../html}/building-isometric_night.jpg | Bin .../html}/codef_core.js | 0 .../html}/codef_scrolltext.js | 0 .../html}/crossdomain.xml | 0 .../html}/demo-codef.html | 0 .../html}/demo.html | 0 .../html}/feed_stream.sh | 0 .../html}/font.png | Bin .../html}/hello_node.js | 0 .../html}/index.html | 0 .../html}/node_modules | 0 .../html}/stream.php | 0 .../html}/visionneuse.html | 0 .../html}/websocket_demo/.ws_test.html.swp | Bin .../websocket_demo/node_modules/udp/README.md | 0 .../node_modules/udp/package.json | 0 .../websocket_demo/node_modules/udp/udp.js | 0 .../node_modules/websocket/CHANGELOG.md | 0 .../node_modules/websocket/LICENSE | 0 .../node_modules/websocket/Makefile | 0 .../node_modules/websocket/README.md | 0 .../node_modules/websocket/binding.gyp | 0 .../node_modules/websocket/build/Makefile | 0 .../node_modules/websocket/build/config.gypi | 0 .../node_modules/websocket/build/gyp-mac-tool | 0 .../websocket/build/validation.target.mk | 0 .../node_modules/websocket/index.js | 0 .../node_modules/websocket/install.js | 0 .../node_modules/websocket/lib/Constants.js | 0 .../node_modules/websocket/lib/Deprecation.js | 0 .../websocket/lib/Validation.fallback.js | 0 .../node_modules/websocket/lib/Validation.js | 0 .../websocket/lib/WebSocketClient.js | 0 .../websocket/lib/WebSocketConnection.js | 0 .../websocket/lib/WebSocketFrame.js | 0 .../websocket/lib/WebSocketRequest.js | 0 .../websocket/lib/WebSocketRouter.js | 0 .../websocket/lib/WebSocketRouterRequest.js | 0 .../websocket/lib/WebSocketServer.js | 0 .../node_modules/websocket/lib/utils.js | 0 .../node_modules/websocket/lib/websocket.js | 0 .../websocket/lib/xor.fallback.js | 0 .../node_modules/websocket/lib/xor.js | 0 .../node_modules/websocket/package.json | 0 .../node_modules/websocket/src/validation.cc | 0 .../node_modules/websocket/src/xor.cpp | 0 .../websocket/vendor/FastBufferList.js | 0 .../websocket/vendor/node-ctype/LICENSE | 0 .../vendor/node-ctype/ctio-faster.js | 0 .../html}/websocket_demo/ws_display.html | 0 .../html}/websocket_demo/ws_server.js | 0 .../html}/websocket_demo/ws_test.html | 0 .../html}/ws_stdin.js | 0 .../html}/ws_udp.js | 0 frameserver/mkbinconv.sh | 18 ++ frameserver/s2l.binconf | 2 + frameserver/s2l.conf | 20 ++ run-it-all1.sh | 6 +- 72 files changed, 353 insertions(+), 6 deletions(-) create mode 100644 displayclient/ardupixel/README create mode 100644 displayclient/ardupixel/ardupixel.ino create mode 100644 displayclient/ardupixel/serial2eeprom/serial2eeprom.ino rename displayclient/{ => cpp-client}/AppWindow.cpp (100%) rename displayclient/{ => cpp-client}/AppWindow.h (100%) rename displayclient/{ => cpp-client}/Makefile (100%) rename displayclient/{ => cpp-client}/Renderer.cpp (100%) rename displayclient/{ => cpp-client}/Renderer.h (100%) rename displayclient/{ => cpp-client}/defines.h (100%) rename displayclient/{ => cpp-client}/main.cpp (100%) rename displayclient/{ => cpp-client}/make_displayclient (100%) rename {displayclienthtml => displayclient/html}/README (100%) rename {displayclienthtml => displayclient/html}/building-isometric_b.jpg (100%) rename {displayclienthtml => displayclient/html}/building-isometric_night.jpg (100%) rename {displayclienthtml => displayclient/html}/codef_core.js (100%) rename {displayclienthtml => displayclient/html}/codef_scrolltext.js (100%) rename {displayclienthtml => displayclient/html}/crossdomain.xml (100%) rename {displayclienthtml => displayclient/html}/demo-codef.html (100%) rename {displayclienthtml => displayclient/html}/demo.html (100%) rename {displayclienthtml => displayclient/html}/feed_stream.sh (100%) rename {displayclienthtml => displayclient/html}/font.png (100%) rename {displayclienthtml => displayclient/html}/hello_node.js (100%) rename {displayclienthtml => displayclient/html}/index.html (100%) rename {displayclienthtml => displayclient/html}/node_modules (100%) rename {displayclienthtml => displayclient/html}/stream.php (100%) rename {displayclienthtml => displayclient/html}/visionneuse.html (100%) rename {displayclienthtml => displayclient/html}/websocket_demo/.ws_test.html.swp (100%) rename {displayclienthtml => displayclient/html}/websocket_demo/node_modules/udp/README.md (100%) rename {displayclienthtml => displayclient/html}/websocket_demo/node_modules/udp/package.json (100%) rename {displayclienthtml => displayclient/html}/websocket_demo/node_modules/udp/udp.js (100%) rename {displayclienthtml => displayclient/html}/websocket_demo/node_modules/websocket/CHANGELOG.md (100%) rename {displayclienthtml => displayclient/html}/websocket_demo/node_modules/websocket/LICENSE (100%) rename {displayclienthtml => displayclient/html}/websocket_demo/node_modules/websocket/Makefile (100%) rename {displayclienthtml => displayclient/html}/websocket_demo/node_modules/websocket/README.md (100%) rename {displayclienthtml => displayclient/html}/websocket_demo/node_modules/websocket/binding.gyp (100%) rename {displayclienthtml => displayclient/html}/websocket_demo/node_modules/websocket/build/Makefile (100%) rename {displayclienthtml => displayclient/html}/websocket_demo/node_modules/websocket/build/config.gypi (100%) rename {displayclienthtml => displayclient/html}/websocket_demo/node_modules/websocket/build/gyp-mac-tool (100%) rename {displayclienthtml => displayclient/html}/websocket_demo/node_modules/websocket/build/validation.target.mk (100%) rename {displayclienthtml => displayclient/html}/websocket_demo/node_modules/websocket/index.js (100%) rename {displayclienthtml => displayclient/html}/websocket_demo/node_modules/websocket/install.js (100%) rename {displayclienthtml => displayclient/html}/websocket_demo/node_modules/websocket/lib/Constants.js (100%) rename {displayclienthtml => displayclient/html}/websocket_demo/node_modules/websocket/lib/Deprecation.js (100%) rename {displayclienthtml => displayclient/html}/websocket_demo/node_modules/websocket/lib/Validation.fallback.js (100%) rename {displayclienthtml => displayclient/html}/websocket_demo/node_modules/websocket/lib/Validation.js (100%) rename {displayclienthtml => displayclient/html}/websocket_demo/node_modules/websocket/lib/WebSocketClient.js (100%) rename {displayclienthtml => displayclient/html}/websocket_demo/node_modules/websocket/lib/WebSocketConnection.js (100%) rename {displayclienthtml => displayclient/html}/websocket_demo/node_modules/websocket/lib/WebSocketFrame.js (100%) rename {displayclienthtml => displayclient/html}/websocket_demo/node_modules/websocket/lib/WebSocketRequest.js (100%) rename {displayclienthtml => displayclient/html}/websocket_demo/node_modules/websocket/lib/WebSocketRouter.js (100%) rename {displayclienthtml => displayclient/html}/websocket_demo/node_modules/websocket/lib/WebSocketRouterRequest.js (100%) rename {displayclienthtml => displayclient/html}/websocket_demo/node_modules/websocket/lib/WebSocketServer.js (100%) rename {displayclienthtml => displayclient/html}/websocket_demo/node_modules/websocket/lib/utils.js (100%) rename {displayclienthtml => displayclient/html}/websocket_demo/node_modules/websocket/lib/websocket.js (100%) rename {displayclienthtml => displayclient/html}/websocket_demo/node_modules/websocket/lib/xor.fallback.js (100%) rename {displayclienthtml => displayclient/html}/websocket_demo/node_modules/websocket/lib/xor.js (100%) rename {displayclienthtml => displayclient/html}/websocket_demo/node_modules/websocket/package.json (100%) rename {displayclienthtml => displayclient/html}/websocket_demo/node_modules/websocket/src/validation.cc (100%) rename {displayclienthtml => displayclient/html}/websocket_demo/node_modules/websocket/src/xor.cpp (100%) rename {displayclienthtml => displayclient/html}/websocket_demo/node_modules/websocket/vendor/FastBufferList.js (100%) rename {displayclienthtml => displayclient/html}/websocket_demo/node_modules/websocket/vendor/node-ctype/LICENSE (100%) rename {displayclienthtml => displayclient/html}/websocket_demo/node_modules/websocket/vendor/node-ctype/ctio-faster.js (100%) rename {displayclienthtml => displayclient/html}/websocket_demo/ws_display.html (100%) rename {displayclienthtml => displayclient/html}/websocket_demo/ws_server.js (100%) rename {displayclienthtml => displayclient/html}/websocket_demo/ws_test.html (100%) rename {displayclienthtml => displayclient/html}/ws_stdin.js (100%) rename {displayclienthtml => displayclient/html}/ws_udp.js (100%) create mode 100755 frameserver/mkbinconv.sh create mode 100644 frameserver/s2l.binconf create mode 100644 frameserver/s2l.conf diff --git a/README.md b/README.md index 89b63ad..ee4c7e8 100644 --- a/README.md +++ b/README.md @@ -12,12 +12,12 @@ The system is set up of various parts. See frameserver.png Latest setup is: -* displayclienthtml/ws_udp.js +* displayclient/html/ws_udp.js ----------------------------- -A nodjs server => $ node displayclienthtml/ws_udp.js +A nodjs server => $ node displayclient/html/ws_udp.js This listens for UDP packets to show on a virtual building This server creates a webserver where a browser can connect to see a simulation -of the building. => $ firefox/chromium displayclienthtml/visionneuse.html +of the building. => $ firefox/chromium displayclient/html/visionneuse.html * frameserver ------------- diff --git a/displayclient/ardupixel/README b/displayclient/ardupixel/README new file mode 100644 index 0000000..8d67e5f --- /dev/null +++ b/displayclient/ardupixel/README @@ -0,0 +1,15 @@ +This recieves a syn2lighs packet via UDP and displays it on an neopixel array +The arduino does the conversion from normal x/y coordinates to physical pixels. +This means thet the physical layout should not be of concern for the +sender of the UDP packet. Top left is always 0,0 + +The neopixel array can be set up several ways: + +Feed in is in one of the 4 corners +From there it goes vertically in zigzag to the opposing side. +e.g. feed in is top left corner +Left down, then 1 right, up gain, 1 right etc... + +Alternatively it can also go horizontally in zigzag to the opposite side + +Enhancement: have dip switches to configure max X/Y and layout diff --git a/displayclient/ardupixel/ardupixel.ino b/displayclient/ardupixel/ardupixel.ino new file mode 100644 index 0000000..a03ffa0 --- /dev/null +++ b/displayclient/ardupixel/ardupixel.ino @@ -0,0 +1,109 @@ +/* syndilights display with arduino and neopixel */ +/* !!!!! this does NOT YET use the syndilights format !!!! */ +/* Based on http://arduino.cc/en/pmwiki.php?n=Reference/EthernetUDPRead */ + +#include +#include +#include +#include +#include // https://learn.adafruit.com/adafruit-neopixel-uberguide/arduino-library + + +// Which pin on the Arduino is connected to the NeoPixels? +#define PIN 6 + +// How many NeoPixels are attached to the Arduino? +#define NUMPIXELS 25 +Adafruit_NeoPixel pixels = Adafruit_NeoPixel(NUMPIXELS, PIN, NEO_GRB + NEO_KHZ800); + +uint16_t brightness = 10; + +// the mac will be filled out by serial number, stored as ascii hex in the eeprom 6 first bytes +byte mac[] = { '2', 'S', 'L', 0, 0, 0 }; // 2(to) S-yn2-L-ights (2 because unicast + locally administered) + +// IPAddress ip(10, 2, 113, 51); // not using ip, will use DHCP + +unsigned int localPort = 8888; // local port to listen on + +// An EthernetUDP instance to let us send and receive packets over UDP +EthernetUDP Udp; + +char packetBuffer[UDP_TX_PACKET_MAX_SIZE]; //buffer to hold incoming packet, +byte tomac[4]; +void setup() { + Serial.begin(9600); + + // you need to store into the EEPROM in the first 6 bytes an ascii version of the serial number. + // read that in and use it for the mac + int j=0; + for(int i=0;i<7;i+=2) { + int v; + v=(int)(EEPROM.read(i)-'0'); + if (v>9) {v-=7;} // adjust for A-F are 7 chars later in ascii table + tomac[j]=v<<4; + v=(int)(EEPROM.read(i+1)-'0'); + if (v>9) {v-=7;} // adjust for A-F are 7 chars later in ascii table + tomac[j++]+=v; + } + mac[3]=tomac[0]; + mac[4]=tomac[1]; + mac[5]=tomac[2]; + + // start the Ethernet and UDP: +// Ethernet.begin(mac,ip); + Ethernet.begin(mac); // use DHCP. This eats 2732 of sketch size + Udp.begin(localPort); + Serial.println("---"); + for (byte thisByte = 0; thisByte < 4; thisByte++) { + // print the value of each byte of the IP address: + Serial.print(Ethernet.localIP()[thisByte], DEC); + Serial.print("."); + } + Serial.println(); + pixels.begin(); +} + +void loop() { + int packetSize = Udp.parsePacket(); + if(packetSize) + { + drawCommand(); + } +} + +uint16_t readSubPixelValue(byte in){ + char s[2]; + pinMode(13, OUTPUT); + + s[0] = (char)in; + //if (s[0] == -1) s[0]='0'; + + s[1] = 0; + uint16_t r = (uint16_t)strtoul(s,NULL,16); + return r; +} + + +void drawCommand() { + Udp.read(packetBuffer,UDP_TX_PACKET_MAX_SIZE); + for(uint16_t i = 0; i +char sID[7]="71B1A0"; // change this to the serial number on the board +#define EEPROM_MIN_ADDR 0 +#define EEPROM_MAX_ADDR 511 +// +// Returns true if the address is between the +// minimum and maximum allowed values, +// false otherwise. +// +// This function is used by the other, higher-level functions +// to prevent bugs and runtime errors due to invalid addresses. +// +boolean eeprom_is_addr_ok(int addr) { + return ((addr >= EEPROM_MIN_ADDR) && (addr <= EEPROM_MAX_ADDR)); +} + + +boolean eeprom_write_bytes(int startAddr, const byte* array, int numBytes) { + // counter + int i; + + // both first byte and last byte addresses must fall within + // the allowed range + if (!eeprom_is_addr_ok(startAddr) || !eeprom_is_addr_ok(startAddr + numBytes)) { + return false; + } + + for (i = 0; i < numBytes; i++) { + EEPROM.write(startAddr + i, array[i]); + } + + return true; +} +// +// Writes a string starting at the specified address. +// Returns true if the whole string is successfully written. +// Returns false if the address of one or more bytes +// fall outside the allowed range. +// If false is returned, nothing gets written to the eeprom. +// +boolean eeprom_write_string(int addr, const char* string) { + // actual number of bytes to be written + int numBytes; + + // we'll need to write the string contents + // plus the string terminator byte (0x00) + numBytes = strlen(string) + 1; + + return eeprom_write_bytes(addr, (const byte*)string, numBytes); +} + +// +// Reads the specified number of bytes from the specified address into the provided buffer. +// Returns true if all the bytes are successfully read. +// Returns false if the star or end addresses aren't between +// the minimum and maximum allowed values. +// When returning false, the provided array is untouched. +// +// Note: the caller must ensure that array[] has enough space +// to store at most numBytes bytes. +// +boolean eeprom_read_bytes(int startAddr, byte array[], int numBytes) { + int i; + + // both first byte and last byte addresses must fall within + // the allowed range + if (!eeprom_is_addr_ok(startAddr) || !eeprom_is_addr_ok(startAddr + numBytes)) { + return false; + } + + for (i = 0; i < numBytes; i++) { + array[i] = EEPROM.read(startAddr + i); + } + + return true; +} + + +// +// Reads a string starting from the specified address. +// Returns true if at least one byte (even only the +// string terminator one) is read. +// Returns false if the start address falls outside +// or declare buffer size os zero. +// the allowed range. +// The reading might stop for several reasons: +// - no more space in the provided buffer +// - last eeprom address reached +// - string terminator byte (0x00) encountered. +// The last condition is what should normally occur. +// +boolean eeprom_read_string(int addr, char* buffer, int bufSize) { + // byte read from eeprom + byte ch; + + // number of bytes read so far + int bytesRead; + + // check start address + if (!eeprom_is_addr_ok(addr)) { + return false; + } + + // how can we store bytes in an empty buffer ? + if (bufSize == 0) { + return false; + } + + // is there is room for the string terminator only, + // no reason to go further + if (bufSize == 1) { + buffer[0] = 0; + return true; + } + + // initialize byte counter + bytesRead = 0; + + // read next byte from eeprom + ch = EEPROM.read(addr + bytesRead); + + // store it into the user buffer + buffer[bytesRead] = ch; + + // increment byte counter + bytesRead++; + + // stop conditions: + // - the character just read is the string terminator one (0x00) + // - we have filled the user buffer + // - we have reached the last eeprom address + while ( (ch != 0x00) && (bytesRead < bufSize) && ((addr + bytesRead) <= EEPROM_MAX_ADDR) ) { + // if no stop condition is met, read the next byte from eeprom + ch = EEPROM.read(addr + bytesRead); + + // store it into the user buffer + buffer[bytesRead] = ch; + + // increment byte counter + bytesRead++; + } + + // make sure the user buffer has a string terminator + // (0x00) as its last byte + if ((ch != 0x00) && (bytesRead >= 1)) { + buffer[bytesRead - 1] = 0; + } + + return true; +} + + +char buf[7]; +void setup() +{ + Serial.begin(9600); + eeprom_read_string(0,buf, 7); // read from addr 0 into buf 7 chars + if(strncmp(buf,sID,6) != 0) { // only write if not yet written + eeprom_write_string(0, sID); // write to adress 0 the ID + } +} + +void loop () { + Serial.println("---"); + Serial.print("old value: "); + Serial.println(buf); + Serial.print("new value: "); + Serial.println(sID); + if(strncmp(buf,sID,6) != 0) { + Serial.println("different"); + } else { + Serial.println("same"); + } +} + diff --git a/displayclient/AppWindow.cpp b/displayclient/cpp-client/AppWindow.cpp similarity index 100% rename from displayclient/AppWindow.cpp rename to displayclient/cpp-client/AppWindow.cpp diff --git a/displayclient/AppWindow.h b/displayclient/cpp-client/AppWindow.h similarity index 100% rename from displayclient/AppWindow.h rename to displayclient/cpp-client/AppWindow.h diff --git a/displayclient/Makefile b/displayclient/cpp-client/Makefile similarity index 100% rename from displayclient/Makefile rename to displayclient/cpp-client/Makefile diff --git a/displayclient/Renderer.cpp b/displayclient/cpp-client/Renderer.cpp similarity index 100% rename from displayclient/Renderer.cpp rename to displayclient/cpp-client/Renderer.cpp diff --git a/displayclient/Renderer.h b/displayclient/cpp-client/Renderer.h similarity index 100% rename from displayclient/Renderer.h rename to displayclient/cpp-client/Renderer.h diff --git a/displayclient/defines.h b/displayclient/cpp-client/defines.h similarity index 100% rename from displayclient/defines.h rename to displayclient/cpp-client/defines.h diff --git a/displayclient/main.cpp b/displayclient/cpp-client/main.cpp similarity index 100% rename from displayclient/main.cpp rename to displayclient/cpp-client/main.cpp diff --git a/displayclient/make_displayclient b/displayclient/cpp-client/make_displayclient similarity index 100% rename from displayclient/make_displayclient rename to displayclient/cpp-client/make_displayclient diff --git a/displayclienthtml/README b/displayclient/html/README similarity index 100% rename from displayclienthtml/README rename to displayclient/html/README diff --git a/displayclienthtml/building-isometric_b.jpg b/displayclient/html/building-isometric_b.jpg similarity index 100% rename from displayclienthtml/building-isometric_b.jpg rename to displayclient/html/building-isometric_b.jpg diff --git a/displayclienthtml/building-isometric_night.jpg b/displayclient/html/building-isometric_night.jpg similarity index 100% rename from displayclienthtml/building-isometric_night.jpg rename to displayclient/html/building-isometric_night.jpg diff --git a/displayclienthtml/codef_core.js b/displayclient/html/codef_core.js similarity index 100% rename from displayclienthtml/codef_core.js rename to displayclient/html/codef_core.js diff --git a/displayclienthtml/codef_scrolltext.js b/displayclient/html/codef_scrolltext.js similarity index 100% rename from displayclienthtml/codef_scrolltext.js rename to displayclient/html/codef_scrolltext.js diff --git a/displayclienthtml/crossdomain.xml b/displayclient/html/crossdomain.xml similarity index 100% rename from displayclienthtml/crossdomain.xml rename to displayclient/html/crossdomain.xml diff --git a/displayclienthtml/demo-codef.html b/displayclient/html/demo-codef.html similarity index 100% rename from displayclienthtml/demo-codef.html rename to displayclient/html/demo-codef.html diff --git a/displayclienthtml/demo.html b/displayclient/html/demo.html similarity index 100% rename from displayclienthtml/demo.html rename to displayclient/html/demo.html diff --git a/displayclienthtml/feed_stream.sh b/displayclient/html/feed_stream.sh similarity index 100% rename from displayclienthtml/feed_stream.sh rename to displayclient/html/feed_stream.sh diff --git a/displayclienthtml/font.png b/displayclient/html/font.png similarity index 100% rename from displayclienthtml/font.png rename to displayclient/html/font.png diff --git a/displayclienthtml/hello_node.js b/displayclient/html/hello_node.js similarity index 100% rename from displayclienthtml/hello_node.js rename to displayclient/html/hello_node.js diff --git a/displayclienthtml/index.html b/displayclient/html/index.html similarity index 100% rename from displayclienthtml/index.html rename to displayclient/html/index.html diff --git a/displayclienthtml/node_modules b/displayclient/html/node_modules similarity index 100% rename from displayclienthtml/node_modules rename to displayclient/html/node_modules diff --git a/displayclienthtml/stream.php b/displayclient/html/stream.php similarity index 100% rename from displayclienthtml/stream.php rename to displayclient/html/stream.php diff --git a/displayclienthtml/visionneuse.html b/displayclient/html/visionneuse.html similarity index 100% rename from displayclienthtml/visionneuse.html rename to displayclient/html/visionneuse.html diff --git a/displayclienthtml/websocket_demo/.ws_test.html.swp b/displayclient/html/websocket_demo/.ws_test.html.swp similarity index 100% rename from displayclienthtml/websocket_demo/.ws_test.html.swp rename to displayclient/html/websocket_demo/.ws_test.html.swp diff --git a/displayclienthtml/websocket_demo/node_modules/udp/README.md b/displayclient/html/websocket_demo/node_modules/udp/README.md similarity index 100% rename from displayclienthtml/websocket_demo/node_modules/udp/README.md rename to displayclient/html/websocket_demo/node_modules/udp/README.md diff --git a/displayclienthtml/websocket_demo/node_modules/udp/package.json b/displayclient/html/websocket_demo/node_modules/udp/package.json similarity index 100% rename from displayclienthtml/websocket_demo/node_modules/udp/package.json rename to displayclient/html/websocket_demo/node_modules/udp/package.json diff --git a/displayclienthtml/websocket_demo/node_modules/udp/udp.js b/displayclient/html/websocket_demo/node_modules/udp/udp.js similarity index 100% rename from displayclienthtml/websocket_demo/node_modules/udp/udp.js rename to displayclient/html/websocket_demo/node_modules/udp/udp.js diff --git a/displayclienthtml/websocket_demo/node_modules/websocket/CHANGELOG.md b/displayclient/html/websocket_demo/node_modules/websocket/CHANGELOG.md similarity index 100% rename from displayclienthtml/websocket_demo/node_modules/websocket/CHANGELOG.md rename to displayclient/html/websocket_demo/node_modules/websocket/CHANGELOG.md diff --git a/displayclienthtml/websocket_demo/node_modules/websocket/LICENSE b/displayclient/html/websocket_demo/node_modules/websocket/LICENSE similarity index 100% rename from displayclienthtml/websocket_demo/node_modules/websocket/LICENSE rename to displayclient/html/websocket_demo/node_modules/websocket/LICENSE diff --git a/displayclienthtml/websocket_demo/node_modules/websocket/Makefile b/displayclient/html/websocket_demo/node_modules/websocket/Makefile similarity index 100% rename from displayclienthtml/websocket_demo/node_modules/websocket/Makefile rename to displayclient/html/websocket_demo/node_modules/websocket/Makefile diff --git a/displayclienthtml/websocket_demo/node_modules/websocket/README.md b/displayclient/html/websocket_demo/node_modules/websocket/README.md similarity index 100% rename from displayclienthtml/websocket_demo/node_modules/websocket/README.md rename to displayclient/html/websocket_demo/node_modules/websocket/README.md diff --git a/displayclienthtml/websocket_demo/node_modules/websocket/binding.gyp b/displayclient/html/websocket_demo/node_modules/websocket/binding.gyp similarity index 100% rename from displayclienthtml/websocket_demo/node_modules/websocket/binding.gyp rename to displayclient/html/websocket_demo/node_modules/websocket/binding.gyp diff --git a/displayclienthtml/websocket_demo/node_modules/websocket/build/Makefile b/displayclient/html/websocket_demo/node_modules/websocket/build/Makefile similarity index 100% rename from displayclienthtml/websocket_demo/node_modules/websocket/build/Makefile rename to displayclient/html/websocket_demo/node_modules/websocket/build/Makefile diff --git a/displayclienthtml/websocket_demo/node_modules/websocket/build/config.gypi b/displayclient/html/websocket_demo/node_modules/websocket/build/config.gypi similarity index 100% rename from displayclienthtml/websocket_demo/node_modules/websocket/build/config.gypi rename to displayclient/html/websocket_demo/node_modules/websocket/build/config.gypi diff --git a/displayclienthtml/websocket_demo/node_modules/websocket/build/gyp-mac-tool b/displayclient/html/websocket_demo/node_modules/websocket/build/gyp-mac-tool similarity index 100% rename from displayclienthtml/websocket_demo/node_modules/websocket/build/gyp-mac-tool rename to displayclient/html/websocket_demo/node_modules/websocket/build/gyp-mac-tool diff --git a/displayclienthtml/websocket_demo/node_modules/websocket/build/validation.target.mk b/displayclient/html/websocket_demo/node_modules/websocket/build/validation.target.mk similarity index 100% rename from displayclienthtml/websocket_demo/node_modules/websocket/build/validation.target.mk rename to displayclient/html/websocket_demo/node_modules/websocket/build/validation.target.mk diff --git a/displayclienthtml/websocket_demo/node_modules/websocket/index.js b/displayclient/html/websocket_demo/node_modules/websocket/index.js similarity index 100% rename from displayclienthtml/websocket_demo/node_modules/websocket/index.js rename to displayclient/html/websocket_demo/node_modules/websocket/index.js diff --git a/displayclienthtml/websocket_demo/node_modules/websocket/install.js b/displayclient/html/websocket_demo/node_modules/websocket/install.js similarity index 100% rename from displayclienthtml/websocket_demo/node_modules/websocket/install.js rename to displayclient/html/websocket_demo/node_modules/websocket/install.js diff --git a/displayclienthtml/websocket_demo/node_modules/websocket/lib/Constants.js b/displayclient/html/websocket_demo/node_modules/websocket/lib/Constants.js similarity index 100% rename from displayclienthtml/websocket_demo/node_modules/websocket/lib/Constants.js rename to displayclient/html/websocket_demo/node_modules/websocket/lib/Constants.js diff --git a/displayclienthtml/websocket_demo/node_modules/websocket/lib/Deprecation.js b/displayclient/html/websocket_demo/node_modules/websocket/lib/Deprecation.js similarity index 100% rename from displayclienthtml/websocket_demo/node_modules/websocket/lib/Deprecation.js rename to displayclient/html/websocket_demo/node_modules/websocket/lib/Deprecation.js diff --git a/displayclienthtml/websocket_demo/node_modules/websocket/lib/Validation.fallback.js b/displayclient/html/websocket_demo/node_modules/websocket/lib/Validation.fallback.js similarity index 100% rename from displayclienthtml/websocket_demo/node_modules/websocket/lib/Validation.fallback.js rename to displayclient/html/websocket_demo/node_modules/websocket/lib/Validation.fallback.js diff --git a/displayclienthtml/websocket_demo/node_modules/websocket/lib/Validation.js b/displayclient/html/websocket_demo/node_modules/websocket/lib/Validation.js similarity index 100% rename from displayclienthtml/websocket_demo/node_modules/websocket/lib/Validation.js rename to displayclient/html/websocket_demo/node_modules/websocket/lib/Validation.js diff --git a/displayclienthtml/websocket_demo/node_modules/websocket/lib/WebSocketClient.js b/displayclient/html/websocket_demo/node_modules/websocket/lib/WebSocketClient.js similarity index 100% rename from displayclienthtml/websocket_demo/node_modules/websocket/lib/WebSocketClient.js rename to displayclient/html/websocket_demo/node_modules/websocket/lib/WebSocketClient.js diff --git a/displayclienthtml/websocket_demo/node_modules/websocket/lib/WebSocketConnection.js b/displayclient/html/websocket_demo/node_modules/websocket/lib/WebSocketConnection.js similarity index 100% rename from displayclienthtml/websocket_demo/node_modules/websocket/lib/WebSocketConnection.js rename to displayclient/html/websocket_demo/node_modules/websocket/lib/WebSocketConnection.js diff --git a/displayclienthtml/websocket_demo/node_modules/websocket/lib/WebSocketFrame.js b/displayclient/html/websocket_demo/node_modules/websocket/lib/WebSocketFrame.js similarity index 100% rename from displayclienthtml/websocket_demo/node_modules/websocket/lib/WebSocketFrame.js rename to displayclient/html/websocket_demo/node_modules/websocket/lib/WebSocketFrame.js diff --git a/displayclienthtml/websocket_demo/node_modules/websocket/lib/WebSocketRequest.js b/displayclient/html/websocket_demo/node_modules/websocket/lib/WebSocketRequest.js similarity index 100% rename from displayclienthtml/websocket_demo/node_modules/websocket/lib/WebSocketRequest.js rename to displayclient/html/websocket_demo/node_modules/websocket/lib/WebSocketRequest.js diff --git a/displayclienthtml/websocket_demo/node_modules/websocket/lib/WebSocketRouter.js b/displayclient/html/websocket_demo/node_modules/websocket/lib/WebSocketRouter.js similarity index 100% rename from displayclienthtml/websocket_demo/node_modules/websocket/lib/WebSocketRouter.js rename to displayclient/html/websocket_demo/node_modules/websocket/lib/WebSocketRouter.js diff --git a/displayclienthtml/websocket_demo/node_modules/websocket/lib/WebSocketRouterRequest.js b/displayclient/html/websocket_demo/node_modules/websocket/lib/WebSocketRouterRequest.js similarity index 100% rename from displayclienthtml/websocket_demo/node_modules/websocket/lib/WebSocketRouterRequest.js rename to displayclient/html/websocket_demo/node_modules/websocket/lib/WebSocketRouterRequest.js diff --git a/displayclienthtml/websocket_demo/node_modules/websocket/lib/WebSocketServer.js b/displayclient/html/websocket_demo/node_modules/websocket/lib/WebSocketServer.js similarity index 100% rename from displayclienthtml/websocket_demo/node_modules/websocket/lib/WebSocketServer.js rename to displayclient/html/websocket_demo/node_modules/websocket/lib/WebSocketServer.js diff --git a/displayclienthtml/websocket_demo/node_modules/websocket/lib/utils.js b/displayclient/html/websocket_demo/node_modules/websocket/lib/utils.js similarity index 100% rename from displayclienthtml/websocket_demo/node_modules/websocket/lib/utils.js rename to displayclient/html/websocket_demo/node_modules/websocket/lib/utils.js diff --git a/displayclienthtml/websocket_demo/node_modules/websocket/lib/websocket.js b/displayclient/html/websocket_demo/node_modules/websocket/lib/websocket.js similarity index 100% rename from displayclienthtml/websocket_demo/node_modules/websocket/lib/websocket.js rename to displayclient/html/websocket_demo/node_modules/websocket/lib/websocket.js diff --git a/displayclienthtml/websocket_demo/node_modules/websocket/lib/xor.fallback.js b/displayclient/html/websocket_demo/node_modules/websocket/lib/xor.fallback.js similarity index 100% rename from displayclienthtml/websocket_demo/node_modules/websocket/lib/xor.fallback.js rename to displayclient/html/websocket_demo/node_modules/websocket/lib/xor.fallback.js diff --git a/displayclienthtml/websocket_demo/node_modules/websocket/lib/xor.js b/displayclient/html/websocket_demo/node_modules/websocket/lib/xor.js similarity index 100% rename from displayclienthtml/websocket_demo/node_modules/websocket/lib/xor.js rename to displayclient/html/websocket_demo/node_modules/websocket/lib/xor.js diff --git a/displayclienthtml/websocket_demo/node_modules/websocket/package.json b/displayclient/html/websocket_demo/node_modules/websocket/package.json similarity index 100% rename from displayclienthtml/websocket_demo/node_modules/websocket/package.json rename to displayclient/html/websocket_demo/node_modules/websocket/package.json diff --git a/displayclienthtml/websocket_demo/node_modules/websocket/src/validation.cc b/displayclient/html/websocket_demo/node_modules/websocket/src/validation.cc similarity index 100% rename from displayclienthtml/websocket_demo/node_modules/websocket/src/validation.cc rename to displayclient/html/websocket_demo/node_modules/websocket/src/validation.cc diff --git a/displayclienthtml/websocket_demo/node_modules/websocket/src/xor.cpp b/displayclient/html/websocket_demo/node_modules/websocket/src/xor.cpp similarity index 100% rename from displayclienthtml/websocket_demo/node_modules/websocket/src/xor.cpp rename to displayclient/html/websocket_demo/node_modules/websocket/src/xor.cpp diff --git a/displayclienthtml/websocket_demo/node_modules/websocket/vendor/FastBufferList.js b/displayclient/html/websocket_demo/node_modules/websocket/vendor/FastBufferList.js similarity index 100% rename from displayclienthtml/websocket_demo/node_modules/websocket/vendor/FastBufferList.js rename to displayclient/html/websocket_demo/node_modules/websocket/vendor/FastBufferList.js diff --git a/displayclienthtml/websocket_demo/node_modules/websocket/vendor/node-ctype/LICENSE b/displayclient/html/websocket_demo/node_modules/websocket/vendor/node-ctype/LICENSE similarity index 100% rename from displayclienthtml/websocket_demo/node_modules/websocket/vendor/node-ctype/LICENSE rename to displayclient/html/websocket_demo/node_modules/websocket/vendor/node-ctype/LICENSE diff --git a/displayclienthtml/websocket_demo/node_modules/websocket/vendor/node-ctype/ctio-faster.js b/displayclient/html/websocket_demo/node_modules/websocket/vendor/node-ctype/ctio-faster.js similarity index 100% rename from displayclienthtml/websocket_demo/node_modules/websocket/vendor/node-ctype/ctio-faster.js rename to displayclient/html/websocket_demo/node_modules/websocket/vendor/node-ctype/ctio-faster.js diff --git a/displayclienthtml/websocket_demo/ws_display.html b/displayclient/html/websocket_demo/ws_display.html similarity index 100% rename from displayclienthtml/websocket_demo/ws_display.html rename to displayclient/html/websocket_demo/ws_display.html diff --git a/displayclienthtml/websocket_demo/ws_server.js b/displayclient/html/websocket_demo/ws_server.js similarity index 100% rename from displayclienthtml/websocket_demo/ws_server.js rename to displayclient/html/websocket_demo/ws_server.js diff --git a/displayclienthtml/websocket_demo/ws_test.html b/displayclient/html/websocket_demo/ws_test.html similarity index 100% rename from displayclienthtml/websocket_demo/ws_test.html rename to displayclient/html/websocket_demo/ws_test.html diff --git a/displayclienthtml/ws_stdin.js b/displayclient/html/ws_stdin.js similarity index 100% rename from displayclienthtml/ws_stdin.js rename to displayclient/html/ws_stdin.js diff --git a/displayclienthtml/ws_udp.js b/displayclient/html/ws_udp.js similarity index 100% rename from displayclienthtml/ws_udp.js rename to displayclient/html/ws_udp.js diff --git a/frameserver/mkbinconv.sh b/frameserver/mkbinconv.sh new file mode 100755 index 0000000..71072a6 --- /dev/null +++ b/frameserver/mkbinconv.sh @@ -0,0 +1,18 @@ +#!/bin/sh +awk -F '=' ' +BEGIN{rows=columns=displays=disprows=dispsegments=0} +/^COLUMNS=/{columns=$2} +/^ROWS=/{rows=$2} +/^DISPLAYS=/{displays=$2} +/^DISPROWS=/{disprows=$2} +/^DISPSEGMENTS=/{dispsegments=$2} +END { + print "s2l" + printf "%c",columns+48 + printf "%c",rows+48 + printf "%c",displays+48 + printf "%c",disprows+48 + printf "%c",dispsegments+48 + print " " +} +' diff --git a/frameserver/s2l.binconf b/frameserver/s2l.binconf new file mode 100644 index 0000000..c6a1a07 --- /dev/null +++ b/frameserver/s2l.binconf @@ -0,0 +1,2 @@ +s2l +<8<18 diff --git a/frameserver/s2l.conf b/frameserver/s2l.conf new file mode 100644 index 0000000..cf2c8a9 --- /dev/null +++ b/frameserver/s2l.conf @@ -0,0 +1,20 @@ +# this file defines the frame format +# it has to be converted to binconf format with mkbinconv.sh +# byte "s2l\n" +# byte windows per row (i.e. max X) in ASCII. in our case 12 => '<' +COLUMNS=12 +# byte rows (i.e. max Y) in ASCII. in our case 8 => '8' +ROWS=8 +# this part is only for having 7 segment displays instead of single pixels +# if you don't need this, set DISPLAYS to 0 +# byte displays per row (usually same as windows per row) '<' +DISPLAYS=12 +# byte disprows (how many rows of 7 segment displays). In our case always '1' +DISPROWS=1 +# byte segments per display (can be 7,8,14 ... depending on the hardware) +DISPSEGMENTS=8 +# byte reserved (future use) currently always set to 0x20 ' ' +# byte z (indicates z level. 1=the most backwards) this is in binary... +# byte '\n' +# byte windows (channels*width+1)*height (so this starts 12 bytes from beginning) +# byte segments displays*(channels*segments+1)*disprows diff --git a/run-it-all1.sh b/run-it-all1.sh index 21f03c2..0cce083 100755 --- a/run-it-all1.sh +++ b/run-it-all1.sh @@ -12,10 +12,10 @@ then exit 1 fi $xt -t "central frameserver" -e frameserver/frameserver & -$xt -t "webserver" -e "$(which node) displayclienthtml/ws_udp.js" & +$xt -t "webserver" -e "$(which node) displayclient/html/ws_udp.js" & sleep 5 -chromium-browser displayclienthtml/visionneuse.html || - x-www-browser displayclienthtml/visionneuse.html & +chromium-browser displayclient/html/visionneuse.html || + x-www-browser displayclient/html/visionneuse.html & $xt -t "client: plasma" -e "python clients/plasma.py" & sleep 20 $xt -t "client: cellular" -e "python clients/cellular.py"