Windows install help!


#1

OMG i have never ever felt so frustrated in all my life!!! Easy Windows install!! My A…

OK. Someone please help my make my Mote setup at east show any form of life after initial booting. So i installed Python? 2.7, pip install mote, runs,
now what?

Please help!!


#2

I’m confused? Are you trying to Install Windows 10 IoT? Or install something “from” a Windows PC? I have no experience with Mote so that may be why I don’t understand what your specific issue is?


#3

Hi. Thanks for the response. I am installing in a windows 10 machine. Well trying too


#4

That’s installing Mote controller or whatever it needs into windows 10 to control the lights.


#5

I’m guessing you follow the tutorials and start coding what you want to happen in python.

https://learn.pimoroni.com/tutorial/sandyj/getting-started-with-mote


#6

Ummmm read that. Over and over. And nothing. I’m guessing it’s because I have the bloody foggiest idea what python is let alone use it. Guessing I was naive enough to read the description of the setup I purchased that said easy to use !! Ummmm no. No its not.


#7

The Mote setup was originally intended to be used with single-board computers that rely heavily on the use of programming languages like Python in order to run, such that it would usually be “easy to use”. In order to program a GUI for each product like you’re used to would take a lot of time! I’m afraid that term very rarely applies to cross-platform uses.
No fear however! Python is a very simple language to learn when you first start out in programming and is pretty easy to get your hands on.
You can download Python from their website here: https://www.python.org/downloads/windows/
and run the examples for the Mote product!
Please inform us how you go with this and if you require any more assistance!


#8

Hi RaspberryPicardBox. Thanks for the message.

I have python 2.7 and 3 installed. I ran pip install mote and it ran through and then I now don’t know what to do ? Says I should type in some code to turn on lights etc but I don’t know where I type this!

Thanks


#9

Ah, good, you’re already half way there!
Do you have a Python IDLE installed anywhere? I’m pretty sure it should have installed one when you installed Python. Try checking in your Python install folder. For Python 3, your should be able to find an executable version here: C:\Python31\Lib\idlelib\idle.bat (I think. I’m using Raspbian ATM, so I’m relying on Google!)

Once you’ve created a new Python file, say, Mote_Control.py you can begin your new Python journey and enter a whole world of confusing errors and run time issues! Yay!

To start off with, copy and paste this code:

#!/usr/bin/env python

import sys
import time

from mote import Mote


mote = Mote()

mote.configure_channel(1, 16, False)
mote.configure_channel(2, 16, False)
mote.configure_channel(3, 16, False)
mote.configure_channel(4, 16, False)


def usage():
    print("Usage: {} <r> <g> <b>".format(sys.argv[0]))
    sys.exit(1)

if len(sys.argv) != 4:
    usage()

# Exit if non integer value. int() will raise a ValueError
try:
    r, g, b = [int(x) for x in sys.argv[1:]]
except ValueError:
    usage()

# Exit if any of r, g, b are greater than 255
if max(r,g,b) > 255:
    usage()

print("Setting Mote to {r},{g},{b}".format(r=r,g=g,b=b))

for channel in range(4):
    for pixel in range(16):
        mote.set_pixel(channel + 1, pixel, r, g, b)
    time.sleep(0.01)

mote.show()

into your new file. It looks complicated now, but you’ll soon get used to it (at least, I hope I do. I’ve never used Mote before 0_0)

This code is part of the examples that should have been downloaded when you ran your PIP install; essentially, it should make your Mote LEDs display a lovely rainbow!

I’m afraid my knowledge is limited for now. but give me a day or two and I’ll get back to you as soon as I can with a line-by-line description of what that program is doing so you can make your own programs in the future. :D

Welcome to the wonderful world of code my friend!


#10

As I peel my eyelids open I have managed to digest most of what you have said. I thank you kindly ! I will have a bash at this again when I am more awake!

Wil let you know my findings shortly.

Thanks again.


#11

Hi, Now awake and followed to the letter what you said. So my steps one by one.

Plugged USB in to Port, Lights flash once each and off.

OPened IDLE. Pste the code you posted above.

On pressing enter it pauses for a second and no lights. I get no error either.


#12

I believe you press F5 from Idle to make the code run. You should see Run as an option in the top menu items. There will be a check module option too that will give you code errors, if there are any. From Idle select File New. Then in the box that opens type in or clip and past your code. Save it with what ever file name you want, then press F5 to run it.


#13

Type Idle into Cortona/Search bar and you’ll fine Idle. Then just right click and past to Start or Taskbar. I have Python installed on my Window 10 PC. I can’t run most of my files on my PC as they are custom to what’s hooked up to my various raspberry Pi’s. I do some quick edits and first drafts though on my PC. Then run them on my Pi to work out the bugs. I use the “Check Module” option there a lot though. In python, indents/tabs will mess you up more than anything, IMHO. Also be careful running something written for python 2 in python 3 and vise versa. There are differences that can mess you up. A lot of tutorials and sample code I’ve come by is written for python 2 and errors out if you run it in python 3. You most likely have Python 3 installed on your PC. My Raspberry Pi running Raspbian has both Python 2 and 3 installed. I try to do everything in Python 3. I personally wouldn’t call Python an easy language to learn. It does get easier the more you use it though. I have absolutely no coding skills at all and I’m getting along quit well now. Some head banging etc at first though.


#14

Yes, as alphanumeric here has said, try running it with the F5 key rather than pressing enter, since you’re not in the live console environment thingy.


#15

Now, as I promised, a step-by-step walk through which will hopefully show you what things are doing here!

#!/usr/bin/env python
# This just defines the environment in which the program should be run in case you launch it from another program.

import sys
import time

from mote import Mote
# Importing the modules that the example needs to run and communicate with Mote.


mote = Mote() # This just makes it easier to write out. It means you don't have to add () to every mote.

mote.configure_channel(1, 16, False)
mote.configure_channel(2, 16, False)
mote.configure_channel(3, 16, False)
mote.configure_channel(4, 16, False)
# This tells the program that there are 4 sticks connected. each with 16 LEDs.

def usage(): # Defining a new function which just tells you to set a RGB value within 255 if you enter an invalid number.
    print("Usage: {} <r> <g> <b>".format(sys.argv[0]))
    sys.exit(1)

if len(sys.argv) != 4: # This activates the usage() function if you enter more than 3 RGB values.
    usage()

# Exit if non integer value. int() will raise a ValueError
try:
    r, g, b = [int(x) for x in sys.argv[1:]]
except ValueError:
    usage() # Again, activates usage() if you enter a non-number value, like "fifteen" rather than "15".

# Exit if any of r, g, b are greater than 255
if max(r,g,b) > 255:
    usage() # Finally, activate usage() if you enter an RGB value above 255.

print("Setting Mote to {r},{g},{b}".format(r=r,g=g,b=b)) # Prints to the console the current status of the mote sticks.

for channel in range(4):
    for pixel in range(16):
        mote.set_pixel(channel + 1, pixel, r, g, b) # Loops through all of the channels pixel's and sets them to the value r, g, b
    time.sleep(0.01)

mote.show() # Finally, the Mote sticks are updated.

Hopefully that helps you understand the script a bit better! :)


#16

Thank you so much!! Will update my progress when I get 5 mins to go through. (More like an hour!!) pesky kiddies off school and demanding !