Welcome, Guest
You have to register before you can post on our site.

Username
  

Password
  





Search Forums

(Advanced Search)

Forum Statistics
» Members: 443
» Latest member: jadenmikey
» Forum threads: 8
» Forum posts: 502

Full Statistics

Online Users
There are currently 7 online users.
» 0 Member(s) | 7 Guest(s)

Latest Threads
Eve is alive!!
Forum: General
Last Post: avanti
01-19-2020, 09:02 PM
» Replies: 5
» Views: 4,615
Frame rate in Sipeed boar...
Forum: K210, Kendryte RISC-V Dual Core 64bit CPU
Last Post: tangocharlie
01-19-2020, 12:05 PM
» Replies: 4
» Views: 162
IDE integration
Forum: K210, Kendryte RISC-V Dual Core 64bit CPU
Last Post: tangocharlie
01-08-2020, 09:44 AM
» Replies: 1
» Views: 63
TouchPin Examples
Forum: ESP32
Last Post: jdts
12-28-2019, 10:07 PM
» Replies: 5
» Views: 919
ESP32 Mesh possible with ...
Forum: ESP32
Last Post: McDiver
12-16-2019, 08:32 PM
» Replies: 4
» Views: 1,636
gps.read_parse('GNRMC') t...
Forum: Issues
Last Post: McDiver
12-15-2019, 07:48 AM
» Replies: 0
» Views: 280
TTGO ESP32 with ST7789V d...
Forum: Hardware
Last Post: dam74
12-13-2019, 04:14 PM
» Replies: 2
» Views: 374
USB Power issues
Forum: ESP32
Last Post: kevgray69
12-13-2019, 10:51 AM
» Replies: 0
» Views: 84
project is dormant?
Forum: General
Last Post: dharya
12-13-2019, 08:18 AM
» Replies: 23
» Views: 5,062
time.sleep() blocking
Forum: General
Last Post: dharya
12-13-2019, 06:31 AM
» Replies: 9
» Views: 12,471

 
  IDE integration
Posted by: tangocharlie - 01-07-2020, 04:58 PM - Forum: K210, Kendryte RISC-V Dual Core 64bit CPU - Replies (1)

Hello

I just got the Sipeed MaixDock boards and I have flashed your firmware MicroPython 1.11.11 (76c3fd1-dirty) built on 2019-08-07; Sipeed_board with Kendryte-K210. The firmware with LittleFS (kpfpkg)

I am able to play with it on the terminal window.

Is there a work flow to integrate it with an IDE other than copy pasting code on to terminal.

If I want to write a JPEG file (from the computer) to the flash  and read the image on maixdock board for displaying on the LCD. How do I go about it, can you point to any samples or equivalent tutorials

Thanks

Print this item

  gps.read_parse('GNRMC') time tuple
Posted by: McDiver - 12-15-2019, 07:48 AM - Forum: Issues - No Replies

When i set my NEO-M8N to 5Hz gps update, i don't get the "decimal" second when using "gps.read_parse('GNRMC')"
See data below. It says ", 1, 349" on every time tuple instead of the decimal seconds during second 28. This makes a problem when differensing the gps positions during a second.

Anyone have a solution for this ??

('RMC', True, (2019, 12, 15, 7, 40, 27, 1, 349), 49.6209297180176, 14.3911571502686, 0.122231999337673, 0.0)
('RMC', True, (2019, 12, 15, 7, 40, 28, 1, 349), 49.6209297180176, 14.3911571502686, 0.116676001876593, 0.0)
('RMC', True, (2019, 12, 15, 7, 40, 28, 1, 349), 49.6209297180176, 14.3911571502686, 0.216683997571468, 0.0)
('RMC', True, (2019, 12, 15, 7, 40, 28, 1, 349), 49.6209335327148, 14.3911561965942, 0.375955989181995, 0.0)
('RMC', True, (2019, 12, 15, 7, 40, 28, 1, 349), 49.6209335327148, 14.3911571502686, 0.201867995142937, 0.0)
('RMC', True, (2019, 12, 15, 7, 40, 28, 1, 349), 49.6209335327148, 14.3911561965942, 0.235204007506371, 0.0)
('RMC', True, (2019, 12, 15, 7, 40, 29, 1, 349), 49.6209335327148, 14.3911561965942, 0.129640000551939, 0.0)

Print this item

  USB Power issues
Posted by: kevgray69 - 12-13-2019, 10:51 AM - Forum: ESP32 - No Replies

Hi All, im new to all the ESP32 and electronics. I have an ESP32 dev board which when its connected via a tablet or Laptop for its power then it all works fine and the WiFi is visable. but when i power it usinig a 3.3v or 5v supply or even if i connect it onto a breadboard with a breadboard power Adapter for this device then the WiFi is never visable.
hopefully someone can explain why this might be Happening.
thanks
kev

Print this item

  TTGO ESP32 with ST7789V display
Posted by: dam74 - 12-10-2019, 04:36 PM - Forum: Hardware - Replies (2)

Hello,
I'm using LILYGO TTGO T-Display ESP32 with ST7789V LCD on Arduino.


it's works well but i would like to use it with micropython.

everything works well with esp32_all, but not the display

does anyone know how to make it working ?

my code :

Code:
import display
tft = display.TFT()
tft.init(tft.ST7789,width=135,height=240,mosi=19,clk=18,cs=5,dc=16,miso=19,rst_pin=23,backl_pin=4,backl_on=1)
tft.rect(10,10,100,100,tft.RED,tft.BLUE)

backlight is on, but it's all

thanks to community

Print this item

  MaixPy
Posted by: dgustavus - 12-09-2019, 10:47 PM - Forum: General - No Replies

Hi,

I have just purchased a Maix Bit and Maix Dock SiPeed Maix board from Seeed. They talk a lot about MaixPy which seems very familiar to someone who has worked with the Loboris ESP32 micropython port. Is your K210 port different from what these guys are doing, or are they associated in some way?

Just trying to figure out which way I want to go when the boards arrive.

Thanks, Duane

Print this item

  Frame rate in Sipeed boards
Posted by: tangocharlie - 12-02-2019, 08:17 AM - Forum: K210, Kendryte RISC-V Dual Core 64bit CPU - Replies (4)

Hello to you

I don't remember how I ended up on this forum, however I assume you are the one who is mentioned in ESP32 github section for providing several fixes.

Can you let me know what is the frame rate that you are able to achieve with the Sipeed K210 board and the OV2640 camera. I am told by the developer that they are unable to get 30FPS in VGA mode. I read on ESP32 camera board fixes, that if the clock is properly configure OV2640 allows 30FPS in VGA.

Can you let me know whether you achieved 30FPS with OV2640 or any other camera module using Kendryte.

Print this item

  CPU halted
Posted by: brettfeeney - 10-24-2019, 12:40 AM - Forum: ESP32 - Replies (2)

Hi there,

very new to micropython, but enjoying it so far. I am a bit of a novice so this may be where my issue lay Smile

I have a script that produces the error ... 

assertion "ATB_GET_KIND(block) == AT_HEAD" failed: file "/home/LoBo2_Razno/ESP32/MicroPython/MicroPython_ESP32_psRAM_LoBo/MicroPython_BUILD/components/micropython/py/gc.c", line 596, function: gc_free

abort() was called at PC 0x40121da3 on core 1

I have seen this mentioned elsewhere on the forum, wrt ports, but none of these discussions help with my current issue.

before posting here I ran the code through flake8 and pylint (ignoring some capitalization formatting etc), to make sure I was somewhat pythonic and free of some issues.

This is code for a flow meter that squirts it's measurements into influxdb, it has 2 threads that I start, one to manage a queue, and the other to keep an eye on the network.

It is no where near complete, and remember I am a novice ... but happy to take pointers to making it better.

Code:
import itertools
import machine
import utime
import _thread
import network
import uheapq
import urequests
#from machine import Pin
import uos
#import gc

sta_if = network.WLAN(network.STA_IF)

class Globals:
   oldTime = 0.0
   newTime = 0.0
   calibrationFactor = 22
   rtc = machine.RTC()
   rtc.ntp_sync(server="au.pool.ntp.org", tz="AEST-10AEDT,M10.1.0,M4.1.0/3")
   INTERRUPTCOUNTER = 0
   myStatus = 0
   journalfile = '/sd/journal.txt'
   readjournalfile = '/sd/readjournal.txt'
   numFlows = 0
   allTimeLiters = 0
   lperSec = 0
   oldqTime = 0
   upTimeStart = 0.0
   upTimeNow = 0.0

newTime = 0.0
flowRate = 0.0
rtc = machine.RTC()
rtc.ntp_sync(server="au.pool.ntp.org", tz="AEST-10AEDT,M10.1.0,M4.1.0/3")
totalInterruptsCounter = 0
oldPrintTime = 0.0
zeroCount = 0
toteMils = 0.0
theChosenOne = 16
counter = itertools.count()

rtc.synced()
myHeap = []
entry_finder = {}
REMOVED = ''
url_string = 'http://192.168.200.20:8086/write?db=Tankdb&precision=u'
urlPre = 'curl -i -XPOST \''
urlData = '\' --data-binary \''



def add_task(task, priority=0):
   'Add a new task or update the priority of an existing task'
   if task in entry_finder:
       remove_task(task)
   count = next(counter)
   entry = [priority, count, task]
   entry_finder[task] = entry
   uheapq.heappush(myHeap, entry)

def remove_task(task):
   'Mark an existing task as REMOVED.  Raise KeyError if not found.'
   entry = entry_finder.pop(task)
   entry[-1] = REMOVED

def pop_task():
   'Remove and return the lowest priority task. Raise KeyError if empty.'
   while myHeap:
       priority, count, task = uheapq.heappop(myHeap)
       if task is not REMOVED:
           del entry_finder[task]
           return task
   #raise KeyError('pop from an empty priority queue')

def tStamper():
   myNow = utime.time()
   if len(str(myNow).split('.')[1]) == 4:
       myU = str(myNow).split('.')[1] + "00"
   if len(str(myNow).split('.')[1]) == 3:
       myU = str(myNow).split('.')[1] + "000"
   if len(str(myNow).split('.')[1]) == 5:
       myU = str(myNow).split('.')[1] + "0"
   if len(str(myNow).split('.')[1]) == 2:
       myU = str(myNow).split('.')[1] + "0000"
   if len(str(myNow).split('.')[1]) == 1:
       myU = str(myNow).split('.')[1] + "00000"
   myuNow = int(str(myNow).split('.')[0] + myU)
   return myuNow

def easyTime():
   myTime = utime.localtime()
   easyT = (str(myTime[0]) + '-' + str("{:02d}".format(myTime[1])) + '-' + str("{:02d}".format(myTime[2])) + 'T' + str("{:02d}".format(myTime[3])) + ':' + str("{:02d}".format(myTime[4])) +  ':' + str("{:02d}".format(myTime[5])))
   return easyT

def queueThread():
   _thread.allowsuspend(True)
   Globals.oldqTime = utime.time()
   while True:
       utime.sleep(0.1)
       ntf = _thread.getnotification()
       if ntf:
           # some notification received
           if ntf == _thread.EXIT:
               print("queueThread: terminated")
               return

       qTime = utime.time()
       if qTime - Globals.oldqTime >= 60000:
           readjournal()
           Globals.oldqTime = utime.time()
       try:
           popped = pop_task()

           if popped is not None:
               Globals.lperSec = popped.split(" ")[0].strip()
               water_flow = popped.split(" ")[1].strip()
               popEd = popped.split(" ")[2].strip()
               popTime = str(popEd.split('.')[0])
               flowy = 'tank_monitor,host=flow01,location=north_east water_flow=' + str(water_flow) + " " + str(popTime) + '\ntank_monitor,host=flow01,location=north_east lPerSec=' + str(Globals.lperSec) + " " + str(popTime)
               #myTime = utime.localtime()

               if Globals.myStatus == 1:
                   #print(urlPre + url_string + urlData + flowy + '\'')
                   addTime = str(tStamper())
                   writejournal(str(Globals.lperSec) + " " + str(water_flow) + " " + addTime + "\n")
                   urequests.post(url_string, data=flowy)
                   #utime.sleep(2)
                   print(easyTime(), '### Sent to DB ###'+addTime+'\n')
                   deletejournal()
               if Globals.myStatus == 0:
                   try:
                       addTime = str(tStamper())
                       #print(urlPre + url_string + urlData + flowy + '\'')
                       writejournal(str(Globals.lperSec) + " " + str(water_flow) + " " + addTime +"\n")
                       print(easyTime(), '### Sent to JOURNAL ###'+addTime+'\n')
                       deletejournal()
                   except Exception as e:
                       print('Error in threadqueue: {}'.format(e))

           elif popped is None:
               utime.sleep(1) #foo = 1 # need something to silence error about empty heap.

       except Exception as e:
           print('Error: {}'.format(e))

def do_connect():
   if sta_if.isconnected() is True:
       print('Network Connected\n')
   if not sta_if.isconnected():
       while True:
           utime.sleep(0.1)
           print('Not Connected\n')
           print('connecting to network...\n')
           sta_if.active(True)
           sta_if.connect('unifi1-out', 'jedrocks')
           utime.sleep(5)
           print(sta_if.isconnected())
           if sta_if.isconnected() is True:
               return
   print('network config:', sta_if.ifconfig())

def networkThread():
   _thread.allowsuspend(True)

   while True:
       utime.sleep(0.1)
       ntf = _thread.getnotification()
       if ntf:
           if ntf == _thread.EXIT:
               print("networkThread: terminated")
               return
       Globals.myStatus = 1
       if sta_if.isconnected() is False:
           print("Network Not Connected")
           Globals.myStatus = 0
           do_connect()
           utime.sleep(10)
           if sta_if.isconnected() is True:
               Globals.myStatus = 1

def datacb(msg):
   if msg[1] == 'test/message' and msg[2] == 'How Are You':
       print('Health Check')
       client.publish('test/message', 'esp32_flow Says, All the people in my village are happy @ ' + str(easyTime()))
   if msg[1] == 'test/message' and msg[2] == 'How Long Have You Been Awake':
       print('Uptime request')
       Globals.myStatus = utime.time()
       curUp = round(Globals.myStatus - Globals.upTimeStart, 2)
       upUpAndAway = utime.strftime('%H:%M:%S', utime.gmtime(int(str(curUp).split('.')[0])))
       client.publish('test/message', 'esp32_flow has been awake for HH:MM:SS: '+ str(upUpAndAway) + " @: " + str(easyTime()))
   if msg[1] == 'test/message' and msg[2] == 'Whats Been Going On':
       print('How much work have I done')
       Globals.myStatus = utime.time()
       curUp = round(Globals.myStatus - Globals.upTimeStart, 2)
       upUpAndAway = utime.strftime('%H:%M:%S', utime.gmtime(int(str(curUp).split('.')[0])))
       client.publish('test/message', 'esp32_flow has flowed '+ str(Globals.numFlows) + ' Times, in ' + str(upUpAndAway) + ' totalling ' + str(Globals.allTimeLiters) + 'L @: ' + str(easyTime()))
   utime.sleep(0.5)

def callback(pin):
   Globals.INTERRUPTCOUNTER = Globals.INTERRUPTCOUNTER + 1


client = network.mqtt(name="pi", server="192.168.200.135", data_cb=datacb, clientid="flowister")
utime.sleep(1)
client.start()
utime.sleep(1)
status = client.status()[1]
print('MQTT status:', status)
client.subscribe('test/message')



def writejournal(what):
   f = open('/sd/journal.txt', "a")
   f.write(what)
   f.close()

def readjournal():
   try:
       myDir = uos.listdir('/sd/')
       print(myDir)
       for myfiles in myDir:
           if myfiles.startswith('readjournal'):
               uos.remove('/sd/readjournal.txt')
               print('### clean up old readjournals')

           if myfiles.startswith('journal.txt'):
               print(myfiles)
               print('### Reading Journal Entries into Queue ###')
               uos.rename('/sd/journal.txt', '/sd/readjournal.txt')
               with open(Globals.readjournalfile) as f:
                   for line in f:
                       line = line.rstrip()
                       add_task(line)
               uos.remove('/sd/readjournal.txt')
   except Exception as e:
       print(e)
       print('### No Journal left layin\' round ###')

def deletejournal():
   uos.remove(Globals.journalfile)


flowSignal = machine.Pin(theChosenOne, machine.Pin.IN, machine.Pin.PULL_UP)
flowSignal.init(trigger=machine.Pin.IRQ_FALLING, handler=callback)

#_thread.stack_size(4*1024)
networkth = _thread.start_new_thread("netty", networkThread, ())
queueth = _thread.start_new_thread("poppy", queueThread, ())



###########################################################

if __name__ == '__main__':
   client.publish('test/message', 'esp32_flow has just come online @ '+ str(easyTime()))
   Globals.upTimeStart = utime.time()
   try:
       #myDir = uos.listdir('/sd/')
       #print("dir", myDir)
       state = machine.disable_irq()
       machine.enable_irq(state)
       readjournal()

       while True:
           utime.sleep(0.1)
           newTime = utime.ticks_ms()
           printTime = newTime

           if Globals.INTERRUPTCOUNTER > 0:
               totalInterruptsCounter = totalInterruptsCounter + 1
               theDiff = newTime - Globals.oldTime

               if Globals.INTERRUPTCOUNTER <= 5 and zeroCount == 0 and totalInterruptsCounter <= 10:
                   client.publish('test/message', 'esp32_flow Started Spooling to Influxdb at ' + str(easyTime()))
                   utime.sleep(0.5)
                   add_task("0 0 " + str(tStamper()-1))
                   print('###   First ZERO')
                   zeroCount = 1

               if theDiff != 0:
                   flowRate = round(((1000 / theDiff) * Globals.INTERRUPTCOUNTER)/Globals.calibrationFactor, 2)

               if printTime - oldPrintTime >= 2000.0:
                   flowMils = round((flowRate/60), 2)
                   toteMils += flowMils
                   fRate = str(round((flowRate/60)*1000, 2))
                   atTime = tStamper()
                   #print("Amount is: ", toteMils, "L, at:", atTime)
                   #print("Flowrate =", fRate + "ml/sec")
                   Globals.lperSec = flowRate
                   oldPrintTime = printTime

                   try:
                       add_task(str(fRate) + " " + str(toteMils) + " " + str(atTime))
                   except Exception as e:
                       print('Error: {}'.format(e))

               Globals.oldTime = newTime
               Globals.INTERRUPTCOUNTER = 0

           if Globals.INTERRUPTCOUNTER == 0 and newTime - Globals.oldTime >= 10000:
               totalInterruptsCounter = 0
               Globals.oldTime = newTime

           #theCollection = theCollection + 1
           #if  theCollection >= 120:
               #gc.collect()
               #myMem = gc.mem_free()
               #print(myMem)
               #theCollection = 0


           if Globals.INTERRUPTCOUNTER == 0 and newTime - oldPrintTime >= 10000 and zeroCount == 1:
               Globals.allTimeLiters = Globals.allTimeLiters + toteMils
               add_task(str(flowRate) + " " + str(toteMils) + " " + str(tStamper()))
               add_task("0 0 " + str(tStamper() + 1))
               print('Last ZERO   ###')
               toteMils = 0
               zeroCount = 0
               flowRate = 0
               #myDir = uos.listdir('/sd/')
               Globals.numFlows = Globals.numFlows + 1
               client.publish('test/message', 'esp32_flow is Done Spooling to Influxdb at ' + str(easyTime()))
               totalInterruptsCounter = 0

   except KeyboardInterrupt:
       print("CNTRL-C has been invoked")
       threadList = _thread.list(False)

       for i in threadList:
           if "netty" in i[2]:
               toSuspend = i[0]
               _thread.stop(toSuspend)

           if "poppy" in i[2]:
               toSuspend = i[0]
               _thread.stop(toSuspend)
So with the information that upy spits out in the core dump, can I determine which part of the script it gets tripped up on ?
cheers
Brett

EDIT: This is running on an esp32 Cam module, but have tested same code on a esp32 Wroom 32, with same results as described above

EDIT2: Seems I have narrowed it down to urequests(), as soon as it fires in the queueThread, that causes the core dump, after a few seconds/minutes ... if I comment it out, the code will run fine for hours (all I have tested)

Print this item

  RA8876 support in Display module?
Posted by: avanti - 10-15-2019, 05:41 PM - Forum: General - No Replies

I see that Boris once worked with the RA8876 display processor, but I can't find any reference to it in the LoBo Display module. Does anyone have a driver for this device?

Print this item

  xpt2046 no calibration
Posted by: bingy - 10-10-2019, 09:32 PM - Forum: Issues - Replies (1)

I have been unable to run the calibration of a touch screen, ILI9341 with XPT2046 touch controller.

Screen initialised:
from machine import SPI,Pin
import display
import tpcalib

tft = display.TFT()
tft.init(tft.ILI9341, width=240, height=320, miso=12,mosi=13,clk=14,cs=15,dc=26, rst_pin=27,tcs=25,hastouch=tft.TOUCH_XPT, bgr=True)

def touch_cal():
    tpc = tpcalib.Calibrate(tft)
    #dosave = True
    tp_type = tft.TOUCH_XPT
    tpc.tpcalib(tp_type)

on calling touch_cal() the screen is displayed, but is unresponsive to touch.
note: tpc.tpcalib(tt_type,dosave) gives 2 errors should be tp_type and only 1 variable required

I have tested the touch functioality using a driver derived from : http://www.ars-informatica.ca/eclectic/x...libration/
.

Any help appreciated

Print this item

  Move ESP32 Camera Project to MicroPython - Webserver, Camera, Overlay
Posted by: xgarb - 09-09-2019, 05:11 PM - Forum: General - Replies (2)

I’m working on an ESP32 camera project (Arduino IDE) that I would like bring over to a K210 based board for performance reasons.

Here’s a quick video demo of what I have at the moment: https://youtu.be/232PdOVPyPg

At the moment I have a web page hosted on the ESP32. Commands and the video stream are over websockets. The cursor overlay uses the IDF gfx library.

How much of this is possible with the current MP port for the K210? I have a Sipeed M1 and the Maixduino.

Print this item