Network LAN RT1062

Hello, how do i go about using the LAN for the RT1062? I would like to configure the default ip address and then attempt to pull a RTSP stream from my board.

I’ve tried running the following lines of code first:

import network
nic = network.LAN(0)

But i get this error

Yeah, you’ll need to buy the PoE Ethernet Shield once we get it on sale.

I’m just waiting on samples for that before I can approve mass production. I have some extra units at my house you can buy though if you want it now. DM me with your info and I can create an order on the store and fedex you one.

Oh! I’m working on a PR now that gets JPEG mode working for the RT1062. It finishes all the features of the camera driver (not DMA offloading yet though). I’ve already been able to test streaming 1080p from the OV5640 and it works well.

Ok cool, will let you know again if i would like to purchase one

May i know how this stream can be accessed?

# This work is licensed under the MIT license.
# Copyright (c) 2013-2023 OpenMV LLC. All rights reserved.
# RTSP Video Server
# This example shows off how to stream video over RTSP with your OpenMV Cam.
# You can use a program like VLC to view the video stream by connecting to the
# OpenMV Cam's IP address.

import network
import omv
import rtsp
import sensor
import time

# RTP MJPEG streaming works using JPEG images produced by the OV2640/OV5640 camera modules.
# Not all programs (e.g. VLC) implement the full JPEG standard for decoding any JPEG image
# in RTP packets. Images JPEG compressed by the OpenMV Cam internally may not display.

# FFPLAY will correctly handle JPEGs produced by OpenMV software.



# Turn off the frame buffer connection to the IDE from the OpenMV Cam side.
# This needs to be done when manually compressing jpeg images at higher quality
# so that the OpenMV Cam does not try to stream them to the IDE using a fall back
# mechanism if the JPEG image is too large to fit in the IDE JPEG frame buffer on the OpenMV Cam.


# Setup Network Interface

network_if = network.WLAN(network.STA_IF)
network_if.connect("ssid", "pass")
while not network_if.isconnected():
    print("Trying to connect. Note this may take a while...")

# Setup RTSP Server

server = rtsp.rtsp_server(network_if)

# For the call back functions below:
# `pathname` is the name of the stream resource the client wants. You can ignore this if it's not
# needed. Otherwise, you can use it to determine what image object to return. By default the path
# name will be "/".
# `session` is random number that will change when a new connection is established. You can use
# session with a dictionary to differentiate different accesses to the same file name.

# Track the current FPS.
clock = time.clock()

def setup_callback(pathname, session):
    print('Opening "%s" in session %d' % (pathname, session))

def play_callback(pathname, session):
    print('Playing "%s" in session %d' % (pathname, session))

def pause_callback(pathname, session):  # VLC only pauses locally. This is never called.
    print('Pausing "%s" in session %d' % (pathname, session))

def teardown_callback(pathname, session):
    print('Closing "%s" in session %d' % (pathname, session))


# Called each time a new frame is needed.
def image_callback(pathname, session):
    img = sensor.snapshot()
    # Markup image and/or do various things.
    return img

# Stream does not return. It will call `image_callback` when it needs to get an image object to send
# to the remote rtsp client connecting to the server., quality=70)

And use the attached firmware. (1.3 MB)

You need to set the framebuffer count to 1 right now. I’m still debugging the JPEG feature. If you use 3 frame buffers you get weird starting and stopping issues. So, this is half the FPS you could do.

Also, note that the camera generates really large JPEGs so you need to tell it to lower it’s quality.

Just to clarify, i will also need to use the WiFi shield for this right?

The RT1062 has WiFi onboard. So, it doesn’t need the WiFi shield.

@limzw Actually, the error only happens at 2 frame buffers. You can use the default of 3. So, I just need to fix the edge case most folks won’t hit.

Got it, managed to test it with the available sample code too thanks!

Noted, thanks!