lwIP on STM32F107 work only with debugger w/STMCubeMX and Keil - stm32

As announced in the title of the post, I am working on STM32 which I want to connect thanks to the Ethernet and LWIP config. Right now, I just want to ping my card.
I followed several tutorials on websites and youtube. My setup is good. I can ping my card at the address configured in lwip.c
BUT I can only ping with the debugger and I need to force the run 4 times to be able to ping and to call my main.c
For a simply soft to blink led, your build, your flash and the system run.
In my case, i need to run 4 times and i can do that only with debugger.
That's happened just if MX_Lwip_init() or/and MX_LWIP_process() are called
I think something happened when i build but i don't know what.
Thanks if someone have response
Have a good day !

Related

Asynchronicity between behavior and flows on Mitmproxy

I am trying to reverse engineer the API of an IoT device using mitmproxy. My setup is an iphone, computer running on MacOS 10.14, and an IoT device (watering pump) that can only access the wireless network after being plugged into the computer via USB connection, i.e. a not genuinely WiFi device. My phone is configured to point to the computer, which is running mitmproxy on a standard configuration.
When I send instructions from the app controlling the device on my phone to the device itself, presumably these instructions are sent to the computer, to the device cloud server, and then to the device. With these assumptions, one would think that they would see the flow of POST requests in mitmproxy before observing the results of those instructions. That is, if you send an instruction to turn on the pump, you'd think you'd see POST request containing that instruction show up in the mitmproxy flows before you see the pump turn on.
However that is not the case here. What happens is that, when I send instructions from the app, I observe the expected behavior from the IoT device, and then the flow of requests appear on the mitmproxy console seemingly at random. There seems to be no determinate relationship between the instructions I send and the requests that appear; they show up 5 seconds later, 5 minutes later, or 30 minutes later. Is this an intentional security feature? To somehow jam MITMproxies so that hackers cannot easily isolate the knowledge of which packet is performing which instruction? Or is it just something that I am doing wrong? Does anyone have any ideas as to what could be happening hear and potential solutions for making the flow of requests appear in real time? Ty

How can I always allowing micrphone and camera access from local files in browser

I'm currently working on a project that uses raspberry pis to communicate with WebRTC. I want one pi to initiate a call with the press of a single button for emergency purposes. Initiating the call means, waking up, opening a browser full screen and starting the call. The problem is that Chromium has a pop up that asks if you want to allow the microphone and camera to be accessed by the browser. I would like to always allow this but the address is a local file and not a site I can add to Chromium's trusted list. Is there a way to circumvent this? Is there another browser I can trust to run quickly on a raspberry pi?
Thanks for your time!
"have you tried starting chrome with --use-fake-ui-for-media-stream? Caveat: will allow camera without prompt for everything – Philipp Hancke 19 hours ago" -first comment
Thanks!

Connecting a Raspberry Pi-3 via T-Mobile GSM SIM with SIM800 Board and SAKIS3G

I want to preface this by saying I am learning Raspberry Pi. This is my first real hands on experience. A project I am working on requires our PI-3 to be connected to the internet via a SIM.
We are using the SIM800 Board (https://www.modmypi.com/raspberry-pi/communication-1068/raspberry-pi-sim800-gsm-breakout-board) and a T-Mobile SIM. Please note that the SIM is already activated.
I followed along with this tutorial and used SAKIS3G: https://www.modmypi.com/blog/how-to-connect-your-raspberry-pi-to-a-3g-network. Everything works until the final selection "custom TTY..."
I receive the following error box: "Device did not report GSM capabilities. You can skip this by adding --noprobe command line switch." I have searched high and low for solutions, but there is very limited information. Does anyone here have experience with errors such as this and can point me in the right direction?
I also added the --noprobe suggestion, but it still printed the same error.
I found a work around, hopefully this is useful for someone. Sakis3G seems to be more focused around other SIM card models rather than T-Mobile. I found a really good guide that allows for easy connection (https://www.rhydolabz.com/wiki/?p=16325).
Follow the link's steps and you should be good. The only flaw with this currently is that it requires manual connection every time the pi boots, but this could probably be fixed by someone who knows R-Pi better than me!

STM32L151 - Debugger starts up at wrong address.. sometimes

I just started working on a STM32L151 microcontroller. I've setup the debugger to break at first instruction (not main), but when I start debugging the program counter stops at 0x1ff00b84 which isn't even a part of the flash (starting at 0x8000000 -> 0x8010000).
It gets wierd, because when i try resetting the debugging session (without downloading the program again), a couple of times it finally stops at the first instruction in my startup-file (startup_stm32l1xx_md.s) and everything runs smoothly until the next time I need the program the device and start the debugger again.
I use CoIDE with the compiler "GNU Tools ARM Embedded 4.8 2014q2".
And I run on some custom HW that just arrived. I use SWD from a STM32 Discovery Board to program the chip with.
Hope someone has an idea?
That address is in the bootloader ROM. This behavior suggests that the BOOT0 pin may be floating; make sure that it is tied to GND to boot from flash.

iPhone proximity detection using wifi

As my iPhone automatically joins my home network once I get home and press the main button, I thought this could be used as a trigger for some home automation ideas I have,
especially disarming the alarm system for example.
I could detect the iPhone by pinging the broadcast address with a script and then look for it's MAC address in the arp cache, but this would have to be done every 15 seconds or so
to be of any use. This really doesn't seem like the most elegant solution though.
Can anyone think of a better way to implement a check like this? I suppose one could assign an IP address dependent on my MAC address, then I would know what to ping, and could thereafter check the MAC address to keep things secure.
Just suppose I cannot assign a DHCP IP based on MAC address, as the problem
of being able to find the MAC address on the network is the part that really interests me.
Secondly I noticed with tcpdump that the iPhone seems to talk to itself all night, but only some sort of Ethernet frames:
23:59:59.740097 00:26:08:ae:ed:eb > 00:26:08:ae:ed:eb, 802.3, length 70: LLC, dsap Null (0x00) Individual, ssap Unknown (0x20) Command, ctrl 0x33: Unnumbered, 23, Flags [Poll], length 56
This happens every 2 minutes.
How could I monitor this traffic so that my "home" knows I am still there using a program? Could be good to automatically alarm the house when I am no longer there...
I think your router here should be the point of control... If you can log the devices that are logged on to the router you can disable your security based on that info.
If you have an openWrt compatible router http://wiki.openwrt.org/toh/start you can certainly extend to get the functionality you want.
Here is a link plugin for the indigo home automation server that does what you want to do bij logging the info from his router. http://www.perceptiveautomation.com/userforum/viewtopic.php?f=19&t=6876&sid=07a351fa04c2eadcd2d3813afc72ae5a
Note: it's really easy to spoof a mac address so might be interesting to have some other verification too :-)