File Transfer using OpenMV WiFi shield

General discussion about topics related to OpenMV.
gwoollett
Posts: 2
Joined: Thu Aug 30, 2018 1:32 am

File Transfer using OpenMV WiFi shield

Postby gwoollett » Thu Aug 30, 2018 1:43 am

I'm new to openmv.
I've been looking at the WiFi examples and am wondering what protocol options I have for sending image frames to a server or cloud service.
Encryption would be nice but not a must have.
ftplib isn't available.
Any help appreciated.
User avatar
iabdalkader
Posts: 552
Joined: Sun May 24, 2015 3:53 pm

Re: File Transfer using OpenMV WiFi shield

Postby iabdalkader » Thu Aug 30, 2018 9:14 pm

Hi, we don't have any streaming protocol implemented, we just send M-JPEG over HTTP.
gwoollett
Posts: 2
Joined: Thu Aug 30, 2018 1:32 am

Re: File Transfer using OpenMV WiFi shield

Postby gwoollett » Thu Sep 20, 2018 10:13 pm

Ok. I have file transfer going but neither zlib or binasii modules supplied include crc32...
Given the this MCU has hardware CRC support, could this be added at sometime.
I cobbled together a crc32 calculation that uses a lookup table but this causes an memory allocation exception.

def create_table():
a = []
for i in range(256):
k = i
for j in range(8):
if k & 1:
k ^= 0x1db710640
k >>= 1
a.append(k) <------ Crashes Here
return a

def crc_update(buf, crc):
crc ^= 0xffffffff
for k in buf:
crc = (crc >> 8) ^ crc_table[(crc & 0xff) ^ k]
return crc ^ 0xffffffff

def GetCRC32(filename):
f = open (filename, "rb")
l = f.read(1024)
crc = crc_update(l,0)
while (l):
l = f.read(1024)
crc = crc_update(l,crc)
f.close()
return crc
crc_table = create_table()

x = GetCRC32('042217_09142018.mjpeg')

Thanks
Graeme
User avatar
kwagyeman
Posts: 2291
Joined: Sun May 24, 2015 2:10 pm

Re: File Transfer using OpenMV WiFi shield

Postby kwagyeman » Fri Sep 21, 2018 12:22 am

Can you repost your code with the code tags. You're likely overflowing the heap which gets fragmented. A way to fix this is to import the gc module, explicitly delete unused variables, and call gc.collect() before your method.
Nyamekye,
User avatar
iabdalkader
Posts: 552
Joined: Sun May 24, 2015 3:53 pm

Re: File Transfer using OpenMV WiFi shield

Postby iabdalkader » Sat Oct 13, 2018 10:56 am

gwoollett wrote:
Thu Sep 20, 2018 10:13 pm
Given the this MCU has hardware CRC support, could this be added at sometime.
Please submit a feature request to github.

Return to “General Topics”

Who is online

Users browsing this forum: No registered users and 4 guests