Giter Club home page Giter Club logo

pico-webserver's Introduction

pico-webserver

Webserver example that came with TinyUSB slightly modified to run on a Raspberry Pi Pico. Lets the Pico pretend to be a USB Ethernet device. Runs a webinterface at http://192.168.7.1/

Build dependencies

On Debian:

sudo apt install git build-essential cmake gcc-arm-none-eabi

Your Linux distribution does need to provide a recent CMake (3.13+). If not, compile CMake from source first.

Build instructions

git clone --depth 1 https://github.com/maxnet/pico-webserver
cd pico-webserver
git submodule update --init
mkdir -p build
cd build
cmake ..
make

Copy the resulting pico_webserver.uf2 file to the Pico mass storage device manually. Webserver will be available at http://192.168.7.1/

Content it is serving is in /fs If you change any files there, run ./regen-fsdata.sh

By default it shows a webpage that led you toggle the Pico's led, and allows you to switch to BOOTSEL mode.

pico-webserver's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

pico-webserver's Issues

Error: "Direct fetching of that commit failed"

Hello,

I'm trying to build pico-webserver according to your build instrcutions on https://github.com/maxnet/pico-webserver.

The following command gives an error:
git submodule update --init --depth 1

remote: Total 0 (delta 0), reused 0 (delta 0)
error: Der Server lehnt Anfrage nach nicht angebotenem Objekt 0056522cc974d2be2005c324f37187b5b3695765 ab.
"fetch" in Submodul-Pfad 'lwip' ausgeführt, aber 0056522cc974d2be2005c324f37187b5b3695765 nicht
enthalten. Direktes Anfordern dieses Commits ist fehlgeschlagen.

Error is "Direct fetching of that commit failed."

Can you please help me?
Thanks a lot.

Best regards,
Michael

Host interface isn't 'up'

I built and installed this, and it worked perfectly - but only after I'd manually brought the host side interface up.
The host is debian 11 on x86

After plugging in, the usb0: device appeared but it wasn't routed, had no address assigned and wasn't 'up'.
I could fix this with
ifconfig usb0: 192.1.7.10 up
(or, presumably, the equivalent 'ip' command)

However in my previous experience of the gadget interface on beaglebone this was done automatically, presumably by dhcp on the gadget side.

Is this normal for this code or has something failed in my build / host ?

Is it possible to serve dynamic data?

Thanks for providing this example! Fantastic!

I am looking at this project as the stepping stone to serve ADC data from the Pico (assuming it can do anywhere close to the actual limit of the theoretical maximum USB throughput on the Pico).

The problem that I see is the data being hardcoded in fsdata.c as static const and served as such to lwipopts.h. Before I bang my head on the keyboard too much, let me instead ask: do you think it would it be possible to replace those hardcoded files of pre-known length with a function call instead, which would read data from the ADC and serve it as the next chunk of bytes (or probably kbytes, to achieve decent throughput)?

I guess I could hardcode a very large size and get away with that part (even thought I might want to stop it before reaching that size, but I should be able to interrupt the transfer regardless and the host should be able to cope with the incomplete file regardless -- or in any case accept the limitation of fixed size if it strictly comes to that).

But how to serve data that is not known at compile time?

Looking at https://lwip.fandom.com/wiki/Lwipopts.h and https://lwip.fandom.com/wiki/Sample_Web_Server it seems that it is not possible (at least not in this form that I am describing, it may be possible in other ways). In any case I am asking here rather than to lwip, because I am not interested in the abstract for what lwip could do on an hypothetical platform. I care specifically for the Pico and I'd expect any reason to use a Pico as a webserver would like to serve dynamic, not pre-made content, hence you may have already explored the issue.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.