No analog video output w/ H7R1, TV shield, Lepton 3.0 - Help

Have H7R1 (firmware 4.4.1) with TV shield attached, Flir Lepton. Everything works fine through USB on the IDE, full functionality. I’m attaching a 5.8 GHz analog video transmitter (external, not the wireless video shield) and a microsd card dvr. All powered through 9v (2s in 9v form factor) li-ion battery, 9v to the VTX and to a buck converter with 5v3a output to the DVR and the VIN pin of the H7. Have a switch with some pins to set color palette, P7 and P9 pulled up to VIN. Everything soldered together, good solder joints and no shorts or anything like that.

On the IDE everything works fine, save to boot from SD card, power up, no video output on the video receiver monitor, no signal from the video pin on the TV shield (from the oscilloscope). I’ve checked all the voltages, continuity checked for shorts, measured current draw. I’ve tried this with three different H7 boards, two different TV shields, three lepton sensors, two VTXs, with and without VTX/DVR attached, different SD cards, I can’t think of anything else that I could be doing wrong. I also tried the tv.py example with the OV7725, still nothing from the video output but works in the IDE. I’m in a time crunch because I have to have this built and shipped before I go on vacation in two days or have to refund a customer their money because I’m past my handling time on eBay.

Any advice would be greatly appreciated. I’m by no means a computer science person, I’m in school for EE so I have some basic understanding of python and C, but it doesn’t work with the tv.py example which is really throwing me. It’s so frustrating because I’ve made this exact setup work a couple of years ago when I was first making the thermal cameras, I decided to go with a rpi zero design because they were much cheaper. I’m switching back to the OpenMV since I can’t hardly get the rpi anymore. When I did this the first time I used the same buck converter and batteries, same VTX. I’ve attached a block diagram I made real quick to help explain and the code is here on github.

openmv_thermal_batt

import machine, sensor, time, tv, pyb

SWITCH_1_PIN = 'P7'
SWITCH_2_PIN = 'P9'

led = pyb.LED(1)
led.on()

switch_state_1 = machine.Pin(SWITCH_1_PIN, machine.Pin.IN).value()
switch_state_2 = machine.Pin(SWITCH_2_PIN, machine.Pin.IN).value()

current_state = 1

if switch_state_1 == 0 and switch_state_2 == 1:
    current_state = 1
elif switch_state_1 == 1 and switch_state_2 == 1:
    current_state = 2
elif switch_state_1 == 1 and switch_state_2 == 0:
    current_state = 3

def set_init_color(current_state):
    if current_state == 1:
        sensor.set_pixformat(sensor.GRAYSCALE)
    elif current_state == 2:
        sensor.set_color_palette(sensor.PALETTE_RAINBOW)
        sensor.set_pixformat(sensor.RGB565)
    elif current_state == 3:
        sensor.set_color_palette(sensor.PALETTE_IRONBOW)
        sensor.set_pixformat(sensor.RGB565)

def handle_interrupt(pin):
    global switch_state_1, switch_state_2, current_state
    switch_state_1 = machine.Pin(SWITCH_1_PIN, machine.Pin.IN).value()
    switch_state_2 = machine.Pin(SWITCH_2_PIN, machine.Pin.IN).value()
    if switch_state_1 == 0 and switch_state_2 == 1:
        current_state = 1
        sensor.set_pixformat(sensor.GRAYSCALE)
    elif switch_state_1 == 1 and switch_state_2 == 1:
        current_state = 2
        sensor.set_color_palette(sensor.PALETTE_RAINBOW)
        sensor.set_pixformat(sensor.RGB565)
    elif switch_state_1 == 1 and switch_state_2 == 0:
        current_state = 3
        sensor.set_color_palette(sensor.PALETTE_IRONBOW)
        sensor.set_pixformat(sensor.RGB565)

switch_1 = machine.Pin(SWITCH_1_PIN, machine.Pin.IN, machine.Pin.PULL_UP)
switch_1.irq(trigger=machine.Pin.IRQ_FALLING | machine.Pin.IRQ_RISING, handler=handle_interrupt)

switch_2 = machine.Pin(SWITCH_2_PIN, machine.Pin.IN, machine.Pin.PULL_UP)
switch_2.irq(trigger=machine.Pin.IRQ_FALLING | machine.Pin.IRQ_RISING, handler=handle_interrupt)

try:
    sensor.reset()
    set_init_color(current_state)
    sensor.set_framesize(sensor.SIF)
    sensor.skip_frames(time=5000)
    sensor.set_vflip(True)
except:
    print("sensor error, resetting...")
    for i in range(9):
        led.off()
        time.sleep_ms(100)
        led.on()
        time.sleep_ms(150)
    machine.reset()
else:
    print("successfully initialized")

clock = time.clock()

tv.init(type=tv.TV_SHIELD, triple_buffer=False)
tv.channel(8)

led.toggle()

while True:
    clock.tick()
    tv.display(sensor.snapshot())

Hi,

First, you need to verify that your script made it to the camera. When you plug the camera into your PC do you see the script on your OpenMV Cam’s flash drive with everything that should be there? If not, you need to save the script to the camera and then safety remove the drive from your PC.

Second… the issue could be some random assert in your code. When this type of things happens you gotta figure out where it is.

Generally, this is the art of debugging. So, you need to reduce your script to the lowest amount of code. See what works, then add back things in until you find the line that has the problem. That said, do this after verifying the camera is even running your application.

Note, you can use the OpenTerminal feature in the IDE to open a serial port window to see what the camera is thinking about without connecting and stopping it’s main script via the connect button in the IDE. Also, you might find making an LED blink will help you trace where the issue is.

I checked the sd card had main.py with the correct code, and added the status LEDs to show where it was in the process. All that seems to work.

I was sure that it was the code until I tried the tv.py example, brand new board except for soldering headers onto it, new tv shield and the sensor that comes with the H7, still no analog signal. I also tried the code I had a couple of years ago that worked and it didn’t output anything either. I’m working through the power stuff to make sure it’s not something there, I’ll try to debug some with the terminal and see what I get.

So, everything works?

Still working on it, redoing all the hardware to see if there’s something I missed. I measured 3.3v on the video out pin, triple checked and didn’t have anything shorted or misplaced.

as i see you split the video signal into 2 receivers.
did you try to send directly to one of them?
also did you try another monitor?
did you check the video signal cable for continuity?
did you check that all the grounds are connected together?
how many meters are the video signal cable?
did you try different resolution?
why you try with tv.init(type=tv.TV_SHIELD, triple_buffer=False) and not with
tv.init(triple_buffer=False)?

I believe I have gotten it working, I had the ground of the buck converter soldered to the ground of the mount where the RCA Jack was when removed it. The Buck converter has a ground pad on the back for heat dissipation maybe, I had kapton tape between the Buck converter and the rest of the pads for everything to stop a short. I don’t know why this would have mattered, I was just changing one thing at a time and that is what worked.

I had tried all of those things, I had multiple monitors but also just had an oscilloscope hooked up to the video output and never got a signal. The transmission cable is only about 6-7, whatever impedance matched it to 50 ohms I can’t remember. It might be a thing with the Buck converter, I’ve never characterized one because they’ve always just worked. I also had never debugged any SPI signal before this, but I was getting what looked like a good signal from all of that. I’m in a microprocessors class in school right now so I’m only learning about lower level stuff, but I think it was a hardware issue. Thanks for the help, I have to build three more of them so if I figure out what the issue is for sure I’ll update the thread incase someone else runs into the same thing.

1 Like