Posts

Showing posts from September, 2024

bensense boardwalk program with pi pico > better version. Works

Image
 Pi pico boardwalk sensor using PicoW with AP network. Seems to work. Better version than bensensor() ones. Here's screen shot when all working: Below is a list of all the files copied into notepad.Also put into pastebin https://pastebin.com/itps554S minresponse3.py #min network web AP server from perplexity. import network import socket import machine import do_csv, do_log adcpin = 4 sensor = machine.ADC(adcpin) # Set up access point ap = network.WLAN(network.AP_IF) te ="" templ = "template1.html"   #update when form changes led = machine.Pin("LED", machine.Pin.OUT) led.on() ap.config(essid='NAME', password='PASSWORD') ap.active(True) while not ap.isconnected():     pass print('AP Mode Is Active, You can Now Connect') print('IP Address To Connect to::', ap.ifconfig()[0]) # Set up socket addr = socket.getaddrinfo('0.0.0.0', 80)[0][-1] s = socket.socket() s.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)   #...

interesting sites and commands

Image
 Got into Ruby with tiny Prog in screen: Btop is a command line hardware monitor. lynx is a command line browser curl wttr.in/dunedin for weather $ cowsay prjbrook@DESKTOP-FGA8Q4U:/usr/bin$ ls -l p* | more (gets all the files in usr/bin that start with p. Links are in blue. Above is dc. The oldest (?) unix app.Like a forth stack.  dc is the oldest surviving  Unix  language program. When its home  Bell Labs  received a  PDP-11 , dc—written in  B —was the first language to run on the new computer, even before an assembler. [ 2 ]   Ken Thompson  has opined that dc was the very first program written on the machine. [ 5 ] Printing all prime numbers [ edit ] echo '2p3p[dl!d2+s!%0=@l!l^!<#]s#[s/0ds^]s@[p]s&[ddvs^3s!l#x0<&2+l.x]ds.x' | dc This program was written by Michel Charpentier. It outputs the sequence of prime numbers. Note that shorter implementation is possible, which reads fourteen symbols less. echo '2p3p[pq]s$[l...

Ben Boardwalk Project finished phase1

Image
THis started to fail when new if--elif options added. REcast as simpler version. Don't use this version. Use next one called minresponse3.py. See above...  Ben Boardwalk Project more or less finished phase1. This is temperature and logging data is captured by PC HTML client form from Pi PicoW web server that's doing the logging and the sensing. Early days but structures seem fine and micropython code is relatively organised. Here is pic of a client session. Just asked for logging data which goes into file dialog query. The main file is the micropython file bensense12.py. It establishes the AP network, called NAME and awaits query from chrome html form called bensensor5.html. Mostly buttons that cause a cascade of if,elif statements to sort through all the options and return with information that gets printed on the form, like temperature or, new work for me, gets the browser to save a log file, not print it, to via a normal Windows dialog.  Here's the main program written i...