Neumi / wifi_camera

A camera that can see WiFi signals.
19 stars 1 forks source link

Directional antenna and esp8285 #1

Open tytarenko opened 10 months ago

tytarenko commented 10 months ago

Hello! That's fantastic! I was truly impressed when I saw your project. It inspired me so much that I ended up ordering 16 esp-01s. I have a couple of ideas. Initially, I attempted to find the radiation pattern of the PCB antenna and came across this visualization.

Screenshot 2023-11-10 at 01 50 03

So, probably, creating a custom PCB module using the esp8285 (because you only need one chip and a few SMD components like resistors, capacitors, etc.) And it would be something like this. IMG_1956 IMG_1957

Neumi commented 10 months ago

Fantastic! It's great to have some actual measurements of the EPS8266. This is actually one of the bigger flaws if we want to measure a "slice" of WiFi because the measurements change if we move the grid around.

I made some PCBs a while ago to do exactly what you described. I ordered 64 ESPs, but the Aliexpress seller tried to scam me :D ... I ended up with 16 on a grid. (but have enough PCBs to get a 64 grid)

This is what the grid looked in the end. (This is not calibrated and I think we have a 'hot' pixel in the top right corner) https://www.youtube.com/shorts/Hjyqzx_mGRc

I had some problems with the power supply, as the ESPs combined needed approximately 3A on startup. And they are very susceptible to an unstable power supply. I used i2c for communication, where every ESP is a slave on the i2c bus. But ESP8266 do not support slave mode natively and get very unstable again ... it was quite a mess :D

Neumi commented 10 months ago

If I'd put more work into it, I'd try to make the software upload OTA or something similar. Or flash them all at the same time (not sure if they would accept that). Programming every pixel one by one was kind of a pain. The addressing should also be automated. I think I had a daisy chain pin to each subsequent ESP to do so. But the code and addresses were all hard coded in the beginning.

tytarenko commented 10 months ago

What do you think about this connection a few devices image

Neumi commented 10 months ago

But you need CS for each device if you want to fetch data by device. This would require 1. many traces on the PCB 2. a master unit with n GPIO pins for every slave and 3. I think the cheap ESP01 modules do have the SPI pins on the pinout. And the flash is also connected via SPI. But that is not in use all the time I assume. esp01_pinout

Neumi commented 10 months ago

Or do you mean to flash the devices via SPI? That would actually be a cool idea. But how do we separate all the devices after flashing? :D I mean it would be possible to build a kind of hardware bootloader that gives each ESP access to one central SPI flash after another... but that sounds a bit too much for this task I guess :D

Neumi commented 10 months ago

TBH that would be a very cool experiment to load firmware to many ESP from one central SPI flash. I wonder if someone has done it before.

tytarenko commented 10 months ago

TBH that would be a very cool experiment to load firmware to many ESP from one central SPI flash. I wonder if someone has done it before.

I think it needs to control access. But, as I said at the beginning, I would like to use esp8685 it’s the same esp8266 but it has integrated flash so you don’t need external chip.

tytarenko commented 10 months ago

I drew this scheme 2333EFF0-E2E2-4FA8-BD9C-398D33D73831

my idea is next attiny1616 has i2c interface and could be as slave. So it has own address. For uploading firmware to each node master has to send command to attiny1616 pull down gpio0 to ground. And after that master can upload firmware to node via uart

Neumi commented 10 months ago

I think we could also use the the ESPs for that. by connecting a gpio to the reset button of the next ESP, we can upload firmware one after another by only releasing the next ESP when the firmware was uploaded to the previous. But we might also need a central reset for that I guess.

tytarenko commented 10 months ago

09343775-E935-4308-A130-DA774D92F73A https://www.infineon.com/dgdl/Infineon-AN205429_FR_CY91460_SPI_Daisy_chain_Communication-ApplicationNotes-v04_00-EN.pdf?fileId=8ac78c8c7cdc391c017d0d03753a5a1f

As I see here that uses only one chip select pin in parallel for all devices. Or I miss something?

Neumi commented 10 months ago

Ah ok this is interesting. They daisy chain the MISO and MOSIs. Never seen that in action, actually. I'm wondering if SPI supports that natively or if they need special chips for that. But if it works the same with the ESPs that would actually be very cool and useful. Does the ESP8285 have SPI out on the boards you have? Because the ESP-01s do not I think.

Neumi commented 10 months ago

Another option would be to use a GPIO expander like mcp23016. This would either give us more CS pins or a controlled reset for each ESP to flash them.

I2c communication is quite handy I think because you only need two wires. (even though ESPs don't support slave mode natively, it works at a reasonable speed).

The firmware upload has to happen via some master controller (that we need anyway to collect the pixel data while running). Then the master sends all controllers to reset and flash mode with the multiplexers and flashes the controllers one after another via normal serial and bootloader.

tytarenko commented 10 months ago

B564D485-E630-4501-A874-FD63D256A8FC

tytarenko commented 10 months ago

And I think about radiation pattern. I tried to draw my idea 8CC252DA-F32F-45F7-9106-A3ADAE7C52B0

Probably it could make radiation for z most mirrored.

tytarenko commented 10 months ago

I have question about distance between modules. In your version of pcb it is 26mm. Is it enough for wave 125mm?

Neumi commented 10 months ago

Why should fiberglass affect the radiation pattern? I thought it would be very similar to air in terms of RF transparency. The 26mm is more a compromise between how many pixels I can fit onto the board and get an OK resolution. If we need a higher resolution, we can still shift the sensor for i.e. 13mm and take a second picture and combine both to double the res. For the larger 20x20x20 image, I had a 1cm resolution. But the ESP antennas are too large for that.

tytarenko commented 10 months ago

About fiberglass, it's my mistake. I made a poor illustration. It should be mirrored fiberglass with copper. Have you thought about updating the firmware via an OTA server?