element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • About Us
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
Personal Blogs
  • Community Hub
  • More
Personal Blogs
Legacy Personal Blogs Project14 IOT Trophy
  • Blog
  • Documents
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
  • Share
  • More
  • Cancel
Group Actions
  • Group RSS
  • More
  • Cancel
Engagement
  • Author Author: scottiebabe
  • Date Created: 29 Oct 2021 8:40 PM Date Created
  • Views 2084 views
  • Likes 0 likes
  • Comments 14 comments
  • project14
Related
Recommended

Project14 IOT Trophy

scottiebabe
scottiebabe
29 Oct 2021

Something special arrived on my doorstep this week!

image

 

I immediately had to open the boxes to see what was inside:

image

It is a collection of Project14 shopping carts!

 

I am beyond enamored to be recognized by the Project14 organizers and community for my project entries!

 

I truly don't have have the words to express my gratitude.

 

So, I as thank you, I put together a quick and simple IOT Project 14 trophy!

 

IOT Trophy

Currently the IOT is a very simple build consisting of:

- ESP8266 NodeMCU V3

- MicroPython

- SSD1306 I2C monochrome OLED 128x64 pixel display

imageimage

boot.py

# This file is executed on every boot (including wake-boot from deepsleep)
import uos, machine, esp, network, time
import gc


gc.collect() 


t0 = time.ticks_us()
wlan = network.WLAN(network.STA_IF)
wlan.active(True)


if not wlan.isconnected():
    print('connecting to network...')
    wlan.connect('ssid', 'pass')
    while not wlan.isconnected():
        pass


print('network config:', wlan.ifconfig())
print( 'Wifi connect time: {} ms'.format((time.ticks_us() - t0)/1000) )

 

 

main.py

There is lots that could be improved here, but its enough to say thanks image

from machine import Pin, I2C
import ssd1306
import socket
import ssl
import re

i2c = I2C(scl=Pin(14), sda=Pin(12), freq=100000)
display = ssd1306.SSD1306_I2C(128, 64, i2c)

rep = {'points' : 0, 'level' : 0, 'GrandPrize' : 0, 'FirstPrize' : 0 }

url = 'http://2n3904blog.com/element14/'
_, _, host, path = url.split('/', 3)
addr = socket.getaddrinfo(host, 80)[0][-1]
s = socket.socket()
s.connect(addr)
s.send(bytes('GET /%s HTTP/1.0\r\nHost: %s\r\n\r\n' % (path, host), 'utf8'))
while True:
    dat = s.read(2048)
    if dat:
        idx = dat.find(b'scottie')
        
        if idx >= 0:
            print('Found Scottie @ index: {}'.format(idx))
            
            m = re.search('<p>Points: <strong>([0-9]+)</strong></p>',dat)
            rep['points'] = int(m.group(1))
            
            m = re.search('<p>Level: ([0-9]+)</p>',dat)
            rep['level'] = int(m.group(1))
            
            m = re.search('<p>GP: ([0-9]+)</p>',dat)
            rep['GrandPrize'] = int(m.group(1))
            
            m = re.search('<p>FP: ([0-9]+)</p>',dat)
            rep['FirstPrize'] = int(m.group(1))
    else:
        break
s.close()


display.text('#~ Project 14 ~#', 0, 0, 1)
display.text('@scottiebabe', 0, 10, 1)
display.text('({}) {} pts'.format(rep['level'],rep['points']), 0, 20, 1)
display.text('GP: {}, FP: {} '.format(rep['GrandPrize'], rep['FirstPrize']), 0, 30, 1)
display.text('EM Surfer', 0, 50, 1)
display.show()

There are definitely still some refinements to be made in the future. I need to determine how to load ssl certificates into uPython, as only a few webservers seem to be supported presently. A low power display is a absolute must for long-term battery powered operation. And, of course, a nicer mechanical build, perhaps a 3-D printed trophy with a display mount.

 

Finally, If you have been on the fence about whether or not to submit a Project14 entry, based on my experience, I would say absolutely go for it. Its a lot fun, there are great prizes, and most importantly you get to share your creations with the world.

 

Looking forward to the next project.

  • Sign in to reply
Parents
  • navadeepganeshu
    navadeepganeshu over 3 years ago

    Awesomeness!!! That's a super creative trophyimage

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
Comment
  • navadeepganeshu
    navadeepganeshu over 3 years ago

    Awesomeness!!! That's a super creative trophyimage

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
Children
  • scottiebabe
    scottiebabe over 3 years ago in reply to navadeepganeshu

    Thanks! The IOT trophy is trying to honor the extensive catalog of creative projects that have been presented by community members on Project14 so far. Can't wait to see what shows up on Project14 next!

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2025 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube