Connected Devices
Week 4 - Device 1
My initial goal was to detect the (electromagnetic) life of a room by picking up magnetic field disturbances from nearby electronics (phones, laptops, etc.), but through testing I realized the range is very small (2 to 10cm) and there’s too much noise for this to be appropriate. I’m now layering sensors for an ambient environment logger that builds a continuous, multi-dimensional portrait of a room over time. It makes visible what is normally invisible: the electromagnetic texture of a space, the presence or absence of people, the rhythms of activity and rest that define how a room actually lives and the people who occupy it. The output should be an art piece inspired by Daniel Canogar’s Billow III (2020). I’m also hoping to scale from there some ‘living’ furniture pieces that trigger local AI workflows, but this in all likelihood will take form after graduation.
# Terminal 1: receives ESP32 data
nc -l 8080 | tee -a log.json &
# -a (append) to preserve previous data across reconnects.
# Terminal 2: serves the dashboard
python3 -m http.server 3000{"device":"RoomSensor","ts":1305264,"mag":{"x":16.00,"y":4.00,"z":-9.00,"mag":18.79},"pir":{"raw":0,"motion":false}}
Could use a Web Socket.
V1

Eletronics in my project
- Sparkfun ESP32 Thing Plus (USB-C)
- Waveshare BMM150 3-Axis Magnetometer Sensor
- SparkFun OpenPIR. Will mount this or a distance sensor facing a doorway or desk area in a wirelessly connected separate device.
Week 3
Tech vs Regulation
A lot of my questions have been developing around internet ethics and what are strategy decisions - from regulators or private companies - and technical limitations. I did not realize how much of what’s possible is almost entirely up to regulation, physical control of server location, App Store locations and internal checks and balances.
Something interesting to understand would be exactly where the tension is between regulation and physical location. Where location is pulled from will depend on the apps architecture and the update upload pipeline created by the App Store.
- Having an EU registered device and App Store linked to EU billing, certain features or updates aren’t available for my region;
- Privacy policy for TikTok is set as Canadian soil because I signed up on Canadian soil;
- Same privacy policy says that I’m subject to the privacy policy of the country I’m using the app from, yet it doesn’t make the US privacy policy available to me as user.
- Finally, I’m barred from accessing a number of services and apps (from very trivial ones to others like Venmo) unless I switch my devices’ region
What I’m realizing is that this really has nothing to do with technicals, but everything to do with how carefully privacy laws are written, which likely does not include cross nation litigation to cover the kind of global movement we see today. Borders seem to be very much in effect and any movement of data or people is all a product of cooperation. It would be worth understanding what can be done in this space and more on the politics of software.
Resource → Electronic Privacy Information Center (Washington-based nonprofit)
Virtual Private Server
Created with Ubuntu OS (Q: how does it relate to Linux? How many are shared commands?), and installed ufw firewall - which means I need to remember to enable certain ports if I want to run multiple servers off of it other than on port 8080 and 8081, blocking incoming traffic other than on certain ports, net-tools, ifconfig (state of network interfaces), SSH key authentication only. To know
- Port 8081, typically used by the p5.serialserver
- Package installations are done like so
sudo apt install nodejs - Shutdown via
sudo poweroffor logout and leave it running withlogout - When I quit the terminal session with ^C, it’s the same as
logoutis done (Q: is it?). The differences might become more material when there are multiple users or perhaps multiple instances of the terminal accessed from the same local machine. - SSH = Secure Shell = Communication Protocol
Rabbit hole of questions semi solved through writing
I don’t want to have to check the droplet’s IP address every time (or else, how do usually devs do it?) so options are:
- SSH config alias - local only, like a keyboard replacement shortcut.
- Replacing hostname with an actual machine name as such
ssh username@myserver.localorsshusername@myserver.com - Off topic Q: Does this provide any insight on how email is architecture? Is each individual inbox a server…? Or more like 1 shared server with database tables?
(Resolved) What I’m not fully getting is why the hostname setup with DigitalOcean isn’t valid to SSH into the server as well and therefore, extra steps are necessary. Likely it makes sense because the hostname from DigitalOcean is only revealed to our local computer once I’m granted access to the server. Since we haven’t yet registered a domain name and created a CDN (?) DNS record for it.
CDN (Content Delivery Network) = Fast delivery network; copies our data to other/more servers worldwide for faster access - instead of for example, just being on NY 2 Datacenter.
(Resolved) I’m recalling some trouble around this when I was setting up a Raspberry Pi and changed networks from home to Sandbox, but can’t pin point exactly what the conditions were since now it makes perfect sense to me why the droplet has a hostname on virtual machine side, but it won't resolve unless DNS (Domain Name System = Internet's phone book) is set up.
Perhaps it was because ssh username@myserver.local is local to the network itself and not my local machine? Bingo.
But I still can’t set this kind of access up for a virtual machine. Raspberry Pi wasn’t a virtual machine - it was just another machine, first with a wired connection and then on the same network as my local machine.
(Unresolved) I suppose this puts into perspective what we mean when we say local machine. Seems like it’s always relative - but is it about physical location and any machine being used to access another is always called the local one? Or is it about being on different networks?
- In my previous example, referring to my MacBook as the local machine makes little sense in the context of a Raspberry Pi wired or with wireless access to internet on the same network. From the network’s perspective, both are local and mDNS is available to create custom hostnames.
- But if I’m accessing that same RaspberryPi from my Macbook, then would professionals in the field refer to the Macbook as the local machine as well?
- (Resolved) When it’s Macbook versus DigitalOcean droplet / server, then indeed the Macbook would be my local machine because it’s on my local network (local as in, the access point (router) with most proximity to me physically) BUT also in relation to the droplet which is accessible on the internet and on a different network (Q). Therefore no
.localaddresses through multicast DNS. Because there’s something “better” ….. just regular DNS. - Side unresolved question: This brings up the question of what do we call intersections of networks - perhaps there’s no need and we’re simply making a request to a separate entity and that’s that.
But… in a world where my home internet provider and the NY Datacenter 2 are the same, and presumably have routers/nodes within range of each other, what would be keeping us from being on the same network? Would it just be corporate decision making to have separation of concerns, access limitations and nothing technical?
Conclusion
Not wanting to check (or memorize) the VPS’s IP address every time is precisely the problem that led to the creation of domain names. So the only way for me not to have to copy the IP address everytime is to get a domain name or set up a silly alias.
On domain names for static sites and server side sites
This is timely as the most expensive domain purchase just took place for ai.com.(Resolved) So when we’re paying for domain names, is it because domain name companies have scanned the internet to find all interesting unregistered domains, then proceeded to register them with Cann themselves and only giving up their registration details (or whatever iCann holds) in exchange for money (also known as making a sale)? YES.
(Resolved) It’s not a sale, it’s rental. Domain Name company still has control over domain registration - they just point an IP address that you provide them with to your chosen domain temporarily. & iCann doesn’t hold actually anything 😭
Or is it because domain name companies bundle it up with other services (like CDN and serving your client only files) and with some marketing sparkle, they package it up for the non-technical folks? YES. depends on the company and what’s their positioning in the market.
Hosting SPAs vs databases
Why does anything with a database/server side fetching cost money to host but client-side only / Single Page Applications / static sites files can be served at presumably no cost?
My single page application hosted with Vercel, domain name 10$/year, free otherwise has files around 1.5GB, with a max of 100mb each.
For another site, I have an PostgreSQL database hosted on Heroku, that I pay 12$/month for but that has ~300mb worth in files.
If all computing is physical, then what kind of services explain this kind of difference - beyond how pricing is structured and that the server side files are more… protected?
Some answers might be in setting up encryption, security, backups, logs ect. Apart from perhaps encryption, aren’t all these things already available as packages for free? Is it just that people don’t want to set them up or is there anything else that I’m missing?
Eg. it was easy&free for me to register trial.space as a domain but there’s additional setup
Learning about networks has shaken up has brought up questions on limitations I’ve experienced over the past 2+ years of learning to code - since I built my computing mental map from the industry, policy and library side, I’m trying to connect with the other technical side and realize a lot of decisions have a product foundation. I’m on my way to the slope of enlightenment…
Resources
For an upcoming rabbit hole,
Look at open source vector embeddings or DIY options vs Digital Ocean’s offering.
Week 2
Final Dashboard
I wanted to use the Accelerometer to create a Dinosaur Game style interaction from Google Chrome’s 404 page in my dashboard. From there I ended up, using it to interact with an old sketch.
Next up would be to increase the communication rate and make the “controller” actually wireless and battery powered.
When I overwork my computer, something interesting has been happening: it gets stuck in a keyboard position but it’s a software issue.
Scan Networks Sketch Serial Monitor:
Please upgrade the firmware
MAC: 8C:AA:B5:8A:C9:04
Scanning available networks...
** Scan Networks **
number of available networks:2
0) MyAltice 540c8b Signal: -83 dBm Encryption: WPA2
1) crab Signal: -94 dBm Encryption: WPA2Running WiFiTCPClient Logger
The Arduino I was using mysteriously lost its WiFi antenna.
Q: is there a reason to be replacing instead of using the value directly?
Q ✅
Serial Monitor showed:
connecting
192.168.1.96
8080When I closed Serial Monitor and opened nc -klw 2 8080, the expected messages of {"device": "first", "AccX": 0.22, "AccY": -0.96, "AccZ": 0.28} started rolling in. Upon closing Serial Monitor, there seemed to be a glitch.
Why? I expected to see the same output on both.
Answer:
Arduino was stuck in a loop because client.connect() kept failing (no server to connect to). Once netcat was running, the connection succeeded, moving past the return to actually read sensors and send data.
To send output of netcat server on port 8080 to log.json, as well as keep sending it to terminal window and keep it running in the background: nc -l 8080 | tee log.json &
Now logging port 8080 data onto log.json, leave it running in the background and spin a web server on port assigned by terminal (?) - 8000
nc -l 8080 >> log.json & python3 -m http.server
Useful Commands
➜ wifi-dashboard echo "# wifi-dashboard" >> README.md
➜ wifi-dashboard echo "# wifi-dashboard" >> .gitignore
➜ wifi-dashboard echo "arduino_secrets.h" >> .gitignore
nano filename # Edit directly
killall nc # kill all netcat processes (were all competing for same port)#TODO Add database of useful commands, shortcuts, aliases? categorized by program.
Making the dashboard interesting
As I know roughly what I want to be seeing, but it would take me more time than I can dedicate, I decided to try and prompt my way into it. To avoid losing anything, I created a GitHub repo.
I did some other fixes in between manually, particularly in regards to timing.
Prompt
I now want to take these barebones HTML Pages and turn them into something visually more interesting. I want to create 3 divs side by side.
1 should show the accelerometer data raw exactly as it comes in.
The second div should be a 3D canvas, either done with the Canvas Browser API or with Three JS. This will require some data processing as I want to use the X, Y; Z coordinates to trace a path. The latest data to come in should have the brightest color and it should diminish in brightness as we see older and older data. Let's have a maximum of 10 data points at any given time being visualized.
The 3rd one for now will be a placeholder.
When possible implement responsive UI.
Result without further changes
Prompt #2
I wanted to use the accelerometer data to interact with something I’ve previously done for one of my websites - https://www.digipeasy.studio. Also have been wanting to explore how much of customization can be done with Claude Code, based on creative direction existing in other projects. It did quite well in one prompt, including copying my existing color codes and imagery.
On desktop, panel 1 will now be above panel 2, to create more room for panel 2.
/Users/ineslucas/code/ineslucas/creative-toolbox/src/pages/SkillsTags.js
For the 3rd panel, you're going to recreate my SkillsTags.js page. Copy the relevant assets from my Creative Toolbox project, including colors and my picture.
I also want you to look at the kind of styling, colors and fonts I'm using in that project and bring those over.
Do not change the tech stack unless you have my explicit permission. I want to keep this as simple as possible.
Prompt #3
Make the 3JS container occupy the full height of the container and have the animation be on or off via a toggle. Default is for animation to be off. Add orbit controls.
In the desktop version, now panel 1 and 2 only occupy 30% of the screen width.
On Panel 3:
- Instead of spinning the balls into the ecosystem through the mouse, let's have that happen on load.
- Make them bigger and let's have 30% less of them.
- Add one in this color #F57935.
- Now I want to use the x and y values of the accelerometer to move the #F57935 colored ball. Of course it should represent the movement I'm doing in reality.
Week 1
Goals for class are around wanting to contribute towards the evolution of small form factor personal devices into what I’ve been calling single purpose hardware if we prioritize personalization and user satisfaction instead of ad driven pricing models.
Electronic devices in my routines
Personal
- Phone
- Laptop
- Wireless Headphones
- Two-factor authentication prompts
- Go Pro & live streaming into app
Home Devices
- Latch Building Door Lock (Bluetooth app)
- Alexa as a speaker and alarm clock with music :(
- Smart bulbs
- Air Purifier
- 3D Printer
- Wifi Router
- Smart TV
- K-beauty LED Tech Device (bluetooth connection to phone app?)
- Photo printer (Wifi connection into phone app)
- Label Maker (not a connected device)
On the go
- MTA Tap to Pay or POS Keypad
- Passport Scanner at the airport
- Buzzer to signal restaurant meal is ready
- Receipt Printers
- Motion Sensors
On campus
- NYU Card to enter building
- System determines # of people on campus setting general AC temp :( + what does that system look like and how does it ‘network’ floor to floor differently than others?
- Charger Locker by the ER
Some affecting my environment indirectly
….. 🤔
Connected Devices
Examples include Arduino to a web server or laptops talking to each other's laptops. IoT is the new connected devices.
Operating Systems
Unix & Linux = POSIX operating systems with similar commands and structure. MacOS is now a Unix OS.
Networking Infrastructure
- VPN = allows you to be in one real network while you're also in the private one
- Virtual Private Server: Instance of an operating system within an operating system = containers. Each instance won't affect other people's instances
How is this different from Docker?
Network Interfaces
Laptop has 3 network layers: WiFi, Bluetooth, Ethernet
Geographies of the internet: OSI Model: Please do not throw sausage pizza away
- Physical layer - What physical medium are you transmitting on?
- Datalink layer - What's your physical address (MAC address), regardless of which network you're on?
- Network layer - What's your network address (IP address)? How do you connect to other networks?
- Transport layer - How are you sending data packets? Should the receiver acknowledge them?
- Session layer - How do you say hello and goodbye?
- Presentation layer - How is the data formatted and/or encrypted? (e.g., HTML)
- Application layer - What are you doing with the data transmitted or received?
Key points
With OSI model, web developers know a lot about presentation and application layer.
MAC address is unique to each computer.
IP (or Inet) number changes everytime you connect to a network. As long as you have an address.
Network Topologies
Random Networks Links between nodes are placed randomly. Messages travel hop by hop to reach distant nodes (distributed network).
Centralized Networks All nodes connect to one central node (star shape). Without the central node, the network is gone.
Decentralized Networks Essentially comprised of hubs, each with a central node. Hubs are linked together. Removal of one hub only affects nodes dependent on it.
The Internet Structure
- No single central router
- Network providers connect to each other through multiple links
- Greater link density = more possible paths = more reliable service
- Complete networks connect every node to every other node, requiring (n²-n)/2 links
Small World Networks
- Strong ties to nearest neighbors, weak ties across larger network
- Weak ties are crucial for connecting the larger network
- Example: finding jobs through acquaintances rather than close friends
Visual Trace Route:
Network Infrastructure
Content Delivery Network = Cloudflare
Autonomous Systems Networks of networks joined using Border Gateway Protocol (BGP). Major ISPs maintain these routers.
IP Addresses
- IPv4: 4 bytes long
- Public IP addresses are unique on the internet
- Private IP address ranges: 10.0.0.0, 172.16.0.0, 192.168.0.0
- Routers have both public and private IP addresses, acting as gateways
Address Assignment
- MAC addresses: Licensed from IEEE, 6 bytes (first 3 = OUI, last 3 = unique device ID)
- IP addresses: Managed by IANA through Regional Internet Registries (RIRs)
- ARP (Address Resolution Protocol): Associates MAC address with IP address
Interface types GUI (the p5 editor for example) vs Text Interfaces (Command line tools?).
Command Line Tools
I’m trying to figure out ways to use AI to standardize format of my notes. Original version lives here. Reformatted clean version is below.
Command Line Tools
Network Diagnostics
nslookup tigoe.net # See IP address for any website
ifconfig en0 # The developer way to check network config
traceroute tigoe.net # Shows network touchpoints/nodes
# Reveals who has info about our trafficFile Management
clear # End terminal instance
ls -l # List with details (shows permissions like drwxr-xr-x)
cat filename # See file contents (stands for concatenate)
cat *.txt # Open all txt files
ls *.txt # List all txt filesSerial Port Access
ls /dev/cu.* # See available serial ports
ls /dev/ # Alternative way
cat /dev/cu.usbmodem101 # Stream data from serial port
# Port name from Arduino IDE or by running diff
# Serial port created after plugging in ArduinoPiping & Background Processes
cat /dev/cu.usbmodem101 >> log.txt # Redirect output to file
cat /dev/cu.usbmodem101 >> log.txt & # Run in background with &
cat myfile.txt | grep Velux # Search for "Velux" in fileProcess Management
ps # List all running processes
kill process_number # Kill a specific processNetwork Tools
nc tigoe.net 80 # Netcat - works over network (vs cat locally)
# Port 80
nc -nklw 2 80 # l=listen, w=wait timeout
man nc # Manual/helpHTTP Server
nc -l 80 # Listen on port 80
/get # Request verb
python3 -m http.server 80 # Serve HTTP on port 80
# Example IP: 10.20.54.224HTTP Protocol
To connect to a server, we use the HTTP protocol:
- Connect on any given port
- Use request verbs (GET, POST) to a specific path
Curl Full-featured tool for HTTP requests