lynchlab
@aoife_l22 · Se unió el abril 2025
Engineering student · university
- Temas
- 15
- Respuestas
- 79
- Puntos
- 0
Respuestas de foro creadas
Traducido del English por IA ·
Guardo una de esas tarjetas de referencia GPIO impresas que se colocan sobre el header. Me ha salvado más de una vez en el laboratorio.
I keep one of those printed GPIO reference cards that slide over the header. Saved me more than once in lab.
Traducido del English por IA ·
¿Tienes los dos transistores entre DTR/RTS y EN/IO0? Los cables directos no logran la secuencia.
Do you have the two transistors between DTR/RTS and EN/IO0? Direct wires won’t do the sequence.
Traducido del English por IA ·
El truco de GPIO4 usa el generador de reloj de la Pi: puede emitir una onda cuadrada de decenas de MHz, y el software varía la frecuencia para generar FM. Una onda cuadrada está llena de armónicos, así que también estás transmitiendo en frecuencias que no tienes derecho a usar. Vale para una demo de laboratorio, pero no lo pondría en la terraza de un hotel.
The GPIO4 trick uses the Pi’s clock generator: it can put out a square wave at tens of MHz, and the software wiggles the frequency to make FM. A square wave is full of harmonics, so you’re also transmitting on frequencies you have no right to use. Fine for a lab demo, I wouldn’t put it on a hotel terrace.
Traducido del English por IA ·
«Upload Using Programmer» es para placas AVR con un programador ISP. Las placas ESP32 no tienen ninguno, por eso el menú está vacío. Aquí el FTDI es un puerto serie normal, usa el botón Upload habitual.Lo que me funciona siempre con estas placas:
- Placa: AI Thinker ESP32-CAM (está en el paquete esp32).
- FTDI a 5 V en el pin 5V, GND a GND, TX a U0R, RX a U0T.
- Puentea IO0 a GND, pulsa el botón de reset y luego Upload.
- Cuando diga Hard resetting, quita el puente de IO0 y pulsa reset otra vez.
@Michael no. La vista en directo de Hermetry necesita un flujo H.264, y el ESP32-CAM sirve MJPEG, que nunca se reproduce. Para un indicador de atasco da igual, solo envías un número.
«Upload Using Programmer» is for AVR boards with an ISP programmer. ESP32 boards don’t have any, so the menu is empty. The FTDI is a plain serial port here, use the normal Upload button.
What works for me every time with these boards:
- Board: AI Thinker ESP32-CAM (it’s in the esp32 package).
- FTDI at 5 V to the 5V pin, GND to GND, TX to U0R, RX to U0T.
- Bridge IO0 to GND, press the reset button, then Upload.
- When it says Hard resetting, remove the IO0 bridge and press reset again.
@Michael no. Live view in Hermetry needs an H.264 stream, and the ESP32-CAM serves MJPEG, which is never played. For a jam flag that’s fine anyway, you only send a number.
Traducido del English por IA ·
¿El robot comprueba que realmente se está cargando después de creer que se ha acoplado?
Does the robot check that it’s actually charging after it thinks it docked?
Traducido del English por IA ·
Eso tampoco lo entiendo. ¿Por qué poner pads para componentes que no vas a soldar?
That’s what I don’t get either. Why put pads for parts you don’t fit?
Traducido del English por IA ·
La regla de «puede llegar dos veces» atrapa a mucha gente, merece la pena incluirla en todo sketch que controle algo físico.
The «may arrive twice» rule catches a lot of people, worth putting in every sketch that drives something physical.
Traducido del English por IA ·
Es el pin. El GPIO 4 está en el ADC2, y en el ESP32 el driver de WiFi usa el ADC2, así que analogRead() en cualquier pin del ADC2 falla mientras el WiFi está activo. Según la versión del core, obtendrás 0, 4095 o un error en el log. El mismo sensor en el GPIO 34 funciona bien. El ADC1 va del GPIO 32 al 39, y los 34-39 son solo de entrada, que es todo lo que necesitas para un sensor.Así que: mueve el cable al GPIO 34 (o 32/33/35/36/39), cambia el número de pin y listo. No hacen falta cambios de código para el WiFi.Dos cosas menores mientras lo revisas. Toma 16 lecturas y promédialas, ya que el ADC del ESP32 es ruidoso y algo no lineal en los extremos. Y envía tanto soil_raw como soil_pct, para poder recalibrar después desde el historial de datos brutos sin reflashear.
const int SOIL = 34; // ADC1_CH6
uint32_t sum = 0;
for (int i = 0; i < 16; i++) { sum += analogRead(SOIL); delay(2); }
int raw = sum / 16;
int pct = constrain(map(raw, 3300, 1500, 0, 100), 0, 100);
It’s the pin. GPIO 4 is on ADC2, and on the ESP32 the WiFi driver uses ADC2, so analogRead() on any ADC2 pin fails while WiFi is on. Depending on the core version you get 0, 4095 or an error in the log. Same sensor on GPIO 34 works fine. ADC1 is GPIO 32-39, and 34-39 are input-only, which is all you need for a sensor.
So: move the wire to GPIO 34 (or 32/33/35/36/39), change the pin number, done. No code changes for WiFi.
Two smaller things while you’re in there. Take 16 readings and average them, the ESP32 ADC is noisy and a bit non-linear at the ends. And send both soil_raw and soil_pct, so you can recalibrate later from the raw history without reflashing.
const int SOIL = 34; // ADC1_CH6
uint32_t sum = 0;
for (int i = 0; i < 16; i++) { sum += analogRead(SOIL); delay(2); }
int raw = sum / 16;
int pct = constrain(map(raw, 3300, 1500, 0, 100), 0, 100);
Traducido del English por IA ·
4 USD × 500 es barato comparado con la certificación de radio. Tome un módulo nRF52832 que lleve su propio FCC ID y documentación CE (el Raytac MDBT42Q es el que usa nuestro laboratorio), siga sus reglas de diseño para la zona libre de la antena, y para todo el producto solo necesitará la prueba de emisiones no intencionadas, que es más barata. Mantenga su firmware como está, el chip es el mismo.Para Hermetry: las etiquetas nunca inician sesión por sí mismas. Coloque una puerta de enlace BLE en cada planta (una Pi o cualquier equipo con BLE y red) que escuche los anuncios y reporte cada etiqueta como un dispositivo hijo a través de la API de la puerta de enlace:
v1/gw/telemetry
{"tag-C4A1F0": {"values": {"temp_c": 4.2, "batt_mv": 2950}},
"tag-C4A1F7": {"values": {"temp_c": 6.8, "batt_mv": 2910}}}
Hermetry crea cada hijo la primera vez que ve el nombre, lo coloca en el «Profile of new children» del perfil de la puerta de enlace, y los hijos nunca tienen credenciales propias. Eso responde a Emily: un token por puerta de enlace, unos tres por edificio, ninguno por etiqueta. Una puerta de enlace admite hasta 500 hijos por defecto, y cada hijo cuenta para el límite de dispositivos del plan.Si dos puertas de enlace en plantas vecinas escuchan la misma etiqueta, decida en las puertas de enlace cuál la reporta; de lo contrario, la recibirá dos veces con dos nombres. Detalles: Devices behind a gateway.
4 USD × 500 is cheap next to radio certification. Take an nRF52832 module that carries its own FCC ID and CE paperwork (Raytac MDBT42Q is the one our lab uses), follow its layout rules for the antenna keep-out, and you only need the cheaper unintentional emissions testing for the whole product. Keep your firmware as is, the chip is the same.
For Hermetry: the tags themselves never log in. You put a BLE gateway on each floor (a Pi or any box with BLE and network) that listens to the adverts and reports each tag as a child device over the gateway API:
v1/gw/telemetry
{"tag-C4A1F0": {"values": {"temp_c": 4.2, "batt_mv": 2950}},
"tag-C4A1F7": {"values": {"temp_c": 6.8, "batt_mv": 2910}}}
Hermetry creates each child the first time it sees the name, puts it in the gateway profile’s «Profile of new children», and children never have credentials of their own. That answers Emily: one token per gateway, three or so per building, nothing per tag. A gateway takes up to 500 children by default, and each child counts toward the plan’s device limit.
If two gateways on neighbouring floors hear the same tag, decide in the gateways which one reports it, otherwise you get it twice under two names. Details: Devices behind a gateway.
Traducido del English por IA ·
No, la cámara es el conector de cinta (CSI) detrás del puerto Ethernet. Creo que P5 es un GPIO extra.
No, the camera is the ribbon connector (CSI) behind the Ethernet port. P5 is extra GPIO I think.
Traducido del English por IA ·
¿Qué versión de placa aparece impresa en la tuya? La v2 y la v3 se comportan de forma diferente.
Which board version is printed on yours? The v2 and v3 behave differently.
Traducido del English por IA ·
El sensor de luz, por cierto, es bastante no lineal. Sirve para «luces encendidas o apagadas», pero no lo trates como lux.
The light sensor is pretty nonlinear btw, fine for «lights on or off» but don’t treat it as lux.
Traducido del English por IA ·
La suposición de Rachel es la más probable. Mismo módulo, distinta placa portadora. Ambas tienen un ESP-12E con el ESP8266, así que tu sketch y los pines son los mismos.La estrecha es el estilo «v2» (diseño Amica): chip USB-serie CP2102, cabe en una protoboard estándar con una fila libre a cada lado.La ancha es el estilo «v3» (LoLin): chip CH340G, más ancha para cubrir todos los agujeros de una protoboard normal, y el pin VU, que es el 5 V del USB. Útil si la interfaz de tu sensor fotoeléctrico necesita 5 V.Windows 10/11 normalmente tiene el driver del CP2102, pero no siempre el del CH340. Instala el driver del CH340 desde el fabricante del chip (WCH), desconecta y vuelve a conectar, y aparecerá como puerto COM. Si aún no muestra nada, prueba con un cable que sepas que transmite datos; muchos cables USB cortos son solo de carga.Para los seis contadores: elige uno y mantente con él para que el cableado y las cajas sean iguales. Yo tomaría la v2 estrecha si prototipas en protoboards, y la v3 si quieres el pin VU. Y cuenta los pulsos con una interrupción, y envía un número por minuto, no un mensaje por cada pulso.
Rachel’s guess is the likely one. Same module, different carrier board. Both have an ESP-12E with the ESP8266 on it, so your sketch and pins are the same.
The narrow one is the «v2» style (Amica design): CP2102 USB-serial chip, fits a standard breadboard with a row free on each side.
The wide one is the «v3» style (LoLin): CH340G chip, wider so it covers all the holes of a normal breadboard, and the VU pin, which is the 5 V from USB. Handy if your photo-eye’s interface needs 5 V.
Windows 10/11 usually has the CP2102 driver, not always the CH340 one. Install the CH340 driver from the chip maker (WCH), unplug and replug, and it’ll appear as a COM port. If it still shows nothing, try a cable you know carries data, a lot of short USB cables are charge-only.
For the six counters: pick one and stick with it so wiring and enclosures are the same. I’d take the narrow v2 if you prototype on breadboards and the v3 if you want the VU pin. And count the pulses with an interrupt, then send one number per minute, not one message per pulse.
Traducido del English por IA ·
¿Está instalado pi-bluetooth? Algunas imágenes mínimas no lo incluyen.
Is pi-bluetooth installed? Some minimal images leave it out.
Traducido del English por IA ·
Un pequeño añadido: aplique un antirrebote a los contactos reed en el firmware (20-50 ms) o una puerta cerrada de golpe enviará tres cambios seguidos.
Small add: debounce the reed switches in firmware (20-50 ms) or a slammed door will send three changes in a row.

