On 30/08/2023 04:23, David Taylor wrote:
> On 29/08/2023 17:40, The Natural Philosopher wrote:
>> I decided to have a PICO day today. Well that's 8 hours of my life I
>> wont get back struggling with the appalling lack of documentation for
>> the PICO W and its toolkit, and for a piece of software that Poettering
>> would be proud of in terms of its utterly unnecessary complexity, bugs
>> and lack of documentation.
>
> You might like to try MicroPython instead.
I don't think you read my original post.
"Anyone who suggests Python will be treated with the contempt that they
deserve." :-)
The problem with Python is that by and large it has bugs that no one can
fix.
At least now if I have stumbled my way through the LWIP and Cmake
morass, I probably have a chance to write code very fast.
It's the old old story, Online are a hundred articles citing the same
examples, and a programmers mumblings that contain the truth that is
however unfortunately only comprehensible to other people 100% familiar
with the code. There is *nothing in between*. Just the odd hint here and
there that you have to piece together to reveals the truth.
The key elements to be understood is that Cmake builds a makefile and a
compile environment, from CMakefiles.txt and it's buggy. Rule #1 is
whenever you invoke it, destroy everything it has built first
(essentially the entire contents of the 'build' directory) because you
cannot guarantee it wont preserve something you don't want.
The second key piece if information that is not highlighted anywhere, is
that when using LWIP library for network, there is a file called
lwipopts.h that you have to edit to select what elements you compile in
from the source, because the libraries exist as source only. And as I
discovered there are hidden dependencies that are not handled well. I am
not using hostnames, but somewhere in the code, these are required by
the library. You cannot actually compile the TCP without them. And you
might also have reasonably thought that if you wanted DHCP the stack
would *automatically* include UDP support.
Er, no.
In short TCP/IP on the Pico has been hacked from the LWIP sources
till it *mostly* works, on a fine day with a following wind, but it is
absolutely unstable, in the Linux sense. Python has presumably used it
as a networking layer and hidden the worst of its ugliness, but it is
still there.
Ah well. Twas ever thus. 99% of the time fighting poor documentation by
clever programmers who didn't get the bugs out because that was too *boring*
Anyone else yearn for the days of a five line C program, followed by CC
<source.c> and ./a.out?
Many thanks to the one person who at least understood the question, and
pointed me in a slightly more fruitful direction.
Next step is to see if it can establish a WiFi connection...
--
It’s easier to fool people than to convince them that they have been fooled.
Mark Twain