[SOLVED] Wireless programming issues

Started by Duck, March 08, 2014, 11:56:56 PM

Duck

So I'm trying to wirelessly program a moteino RFM12B based radio, but with the two example programs (the wireless node program having the blink delay changed, then compiled to a hex) I get this:



Any guess on what's going on?

Felix

Not sure what your setup is, but you should have:


Then you run this python script with the parameters you seem to have included correctly:
https://github.com/LowPowerLab/WirelessProgramming/blob/master/WirelessProgramming.py

Duck

Yes that is what I do. I took a video of my setup. Now these moteinos are rather old, they are from 22-04-2013, so maybe the custom optiboot isn't on there (R2 moteino)

Here's the video:
http://www.youtube.com/watch?v=8gB0sLzNNtA

Felix

Looks like there's a communication issue between the gateway Moteino and python. It's not responding at all. The first thing it does is it tried to set the target, then do the programming handshake. I don't see a reply from the gateway at all. So even older Moteinos should at least respond to that.
Let me try it on a bunch of my own RFM12B nodes when I get a change later on, and get back to you with my results.

Felix

On a second look I don't think you're running the latest code.
I see you're passing the -t param but I don't see that in the python code you're running.
Please get the latest of the 3 links I shared above and try again.

Duck

Yes that seems to have done it. It's weird because I downloaded the library yesterday, and just used the file in the examples folder. I might have overwritten the new folder with the old one tho, and not the other way around. This worked flawlessly :)

I will see if I can get into pyton or java or C#, and make a GUI that will use the AVR dude compiler to compile an arduino program to a hex, and then send it to a gateway. For multiplatform I think I will stick to python or JAVA. (I have yet to write more that hello worlds tho so while I think I can do this, it won't be quick :P)

Felix

Great :)
I would stick with Python if possible. I'm trying to get a grip on Tkinter for the GUI.
Even something simple will do, just turn verbose compilation ON in Arduino, grab the path to the HEX and paste it in the GUI, provide other parameters and click "Wirelessly UPLOAD" :)

Duck

For the time being I threw together a batch script that asks for the paths and such needed. Tested to work :)

I've attached it as a ZIP if you are interested :)

Duck

Actually, I googled a bit, and would say (not really knowing what I'm doing :P) that you should go for wxPython, mostly because of this awesome program:
http://sourceforge.net/projects/wxformbuilder/

I have built this GUI (No actual working code) For a person who knows python, it should be fairly simple to populate the drop down box with the available serial ports on the computer, and use the info from the GUI to run your serial script.

Here's a screenshot:


Here's the python code generated by the program:
# -*- coding: utf-8 -*- 

###########################################################################
## Python code generated with wxFormBuilder (version Feb 26 2014)
## http://www.wxformbuilder.org/
##
## PLEASE DO "NOT" EDIT THIS FILE!
###########################################################################

import wx
import wx.xrc

###########################################################################
## Class mainWindow
###########################################################################

class mainWindow ( wx.Panel ):
	
	def __init__( self, parent ):
		wx.Panel.__init__ ( self, parent, id = wx.ID_ANY, pos = wx.DefaultPosition, size = wx.Size( 319,150 ), style = wx.TAB_TRAVERSAL )
		
		fgSizer1 = wx.FlexGridSizer( 0, 2, 0, 0 )
		fgSizer1.SetFlexibleDirection( wx.BOTH )
		fgSizer1.SetNonFlexibleGrowMode( wx.FLEX_GROWMODE_SPECIFIED )
		
		self.m_staticText1 = wx.StaticText( self, wx.ID_ANY, u"Serial port", wx.DefaultPosition, wx.DefaultSize, 0 )
		self.m_staticText1.Wrap( -1 )
		fgSizer1.Add( self.m_staticText1, 0, wx.ALL, 5 )
		
		fileChoices = [ u"A", u"B", u"C" ]
		self.file = wx.Choice( self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, fileChoices, 0 )
		self.file.SetSelection( 0 )
		fgSizer1.Add( self.file, 0, wx.ALL, 5 )
		
		self.m_staticText2 = wx.StaticText( self, wx.ID_ANY, u"File to upload", wx.DefaultPosition, wx.DefaultSize, 0 )
		self.m_staticText2.Wrap( -1 )
		fgSizer1.Add( self.m_staticText2, 0, wx.ALL, 5 )
		
		self.hexPicker = wx.FilePickerCtrl( self, wx.ID_ANY, wx.EmptyString, u"Select a file", u"*.*", wx.DefaultPosition, wx.DefaultSize, wx.FLP_DEFAULT_STYLE )
		fgSizer1.Add( self.hexPicker, 0, wx.ALL, 5 )
		
		self.m_staticText3 = wx.StaticText( self, wx.ID_ANY, u"Node ID", wx.DefaultPosition, wx.DefaultSize, 0 )
		self.m_staticText3.Wrap( -1 )
		fgSizer1.Add( self.m_staticText3, 0, wx.ALL, 5 )
		
		self.nodeID = wx.TextCtrl( self, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.DefaultSize, 0 )
		fgSizer1.Add( self.nodeID, 0, wx.ALL, 5 )
		
		self.uploadBtn = wx.Button( self, wx.ID_ANY, u"upload", wx.DefaultPosition, wx.DefaultSize, 0 )
		fgSizer1.Add( self.uploadBtn, 0, wx.ALL, 5 )
		
		self.m_gauge1 = wx.Gauge( self, wx.ID_ANY, 100, wx.DefaultPosition, wx.DefaultSize, wx.GA_HORIZONTAL )
		self.m_gauge1.SetValue( 0 ) 
		fgSizer1.Add( self.m_gauge1, 0, wx.ALL, 5 )
		
		
		self.SetSizer( fgSizer1 )
		self.Layout()
	
	def __del__( self ):
		pass


and attached is the fbp file for that program :)