- Netduino Forums
- → AxelG's Content
AxelG's Content
There have been 52 items by AxelG (Search limited from 06-May 23)
#33957 Several stupid questions
Posted by AxelG on 20 August 2012 - 05:03 PM in Netduino 2 (and Netduino 1)
Welcome. You can find a good review of bread boarding here:Bread Board They will also cover your question about LEDs. The wires used for bread boards will work nicely to connect to your Netduino.
Good luck and have fun.
#44466 Adafruit LCD MCP23017 IC
Posted by AxelG on 29 January 2013 - 01:44 AM in Netduino Plus 2 (and Netduino Plus 1)
Can you post a schematic?
I2C is sensitive to the pullup resistor values used on the SDA SCL wires.
#46682 Running ND+ and ND+2 on the same VM
Posted by AxelG on 05 March 2013 - 02:30 PM in Netduino Plus 2 (and Netduino Plus 1)
All of my ND and ND+ gen 1 and gen 2 are flashed to the latest firmware and everything running under 4.2 NETMF.
ND gen 1: 4.2.0.1
ND+ gen 1 4.2.0.1
ND+ gen 2 4.2.2.2
All the gen 1s are running WINUSB and gen 2 MFUSB on the latest VM Player 5.0 Win7 ultimate 64 bit.
I can get all my gen 1 running OK together. I have to reconnect them often in order to deploy and get into debug, but it is workable.
For the most part when running the gen 2 alone, deploying and debugging works OK. If the gen 2 stops responding and needs to be disconnected; I will 100% of the time get a BSOD. (It's not always fun having the ND+2 act as a hardware reset button in the middle of coding a project )
#46628 Running ND+ and ND+2 on the same VM
Posted by AxelG on 04 March 2013 - 08:29 PM in Netduino Plus 2 (and Netduino Plus 1)
Doe anyone have experience running a development environment with two Netduinos? Specifically one ND+ and one ND+2?
I was getting BSOD and decided to rebuild my environment and now I can't seem to communicate with two NDs. It will recognize one or the other but not both.
I can use ND and ND+ without a problem, it's only when I plus in the ND2...
#33919 Love for Chris Walker
Posted by AxelG on 19 August 2012 - 09:29 PM in General Discussion
#29505 First chance Socket Exception on socket.Accept()
Posted by AxelG on 22 May 2012 - 02:35 AM in Netduino Plus 2 (and Netduino Plus 1)
Sometimes, Socket.Accept will throw an Exception. It's only sometimes, and it's immediately after the program starts.
I do have a busy loop in to wait for an IP to be assigned, but otherwise I can't figure out what going on here. Ideas?
Chris:
The only way I can get Sockets to work is to catch the 10053 exception, sleep for 100ms and immediately try again. Sometimes it works on second or third try; sometimes more. I am not sure you are getting the same error code; can you post the debug?
#46335 Xbee to LCD using Netduino
Posted by AxelG on 27 February 2013 - 01:30 PM in Netduino 2 (and Netduino 1)
#43999 Multithreading and writing to SD card
Posted by AxelG on 23 January 2013 - 06:40 AM in Netduino Plus 2 (and Netduino Plus 1)
Thanks for this reply. Could you explain what is meant by a "locking scheme"?
Sure:
In my code I open the Filestream once and keep it open. It would be a bad thing if multiple threads interacted with the the stream at "the same time". I therefore create an object to lock it (private object LockMe = new object() and any time I am reading or writing to the filestream I make sure the code holds a lock on this object (lock(LockMe) { //Code here } )
This way, you can ensure only one thread is interacting with the filestream at any given time. Just make sure the scope of LockMe is shared between all threads.
I hope this helps. You can google "C# lock()" for more reference.
#47373 Building my own custom Netduino Plus 2 hardware
Posted by AxelG on 19 March 2013 - 07:07 AM in Netduino Plus 2 (and Netduino Plus 1)
lol, doing the same with my 2012 Hemi Charger....
#47355 Building my own custom Netduino Plus 2 hardware
Posted by AxelG on 18 March 2013 - 09:56 PM in Netduino Plus 2 (and Netduino Plus 1)
Dave:
Thanks for the reply. We did, and actually still are considering that option. Longer term we want to use the larger 100 pin STM chip to take advantage of extra IO.
We also wanted the first generation to tap into SPI3 for the onboard SD card: but I can always mount the SD on SPI1 with ND2.
One factor is having a real-time CAN bus capturing OBD data. Still have not decided on the best approach; but it would be nice not having to add a lot of hardware to do that.
Cost is not the only factor; total size is also a design factor, which is why we jettisoned the Ethernet. There are several add-on devices needed to fit into a total footprint < 3" X 3"
As always, thanks for the insight!
#47342 Building my own custom Netduino Plus 2 hardware
Posted by AxelG on 18 March 2013 - 07:01 PM in Netduino Plus 2 (and Netduino Plus 1)
I have been asked to help with a project to build a device based on the Netduino framework and the STM32F405 family of processors.
We expect to use the same processor as the Plus 2, but leave off the ethernet hardware (we need the flash, not the ethernet) There is also a possibility of going to a larger package in the future to expose more peripherals; like a CAN bus.
I have two questions for anyone with experience building their own device.
1) For the first revision I would like to avoid having to recompile the ND firmware and just flash the current build to the new device. Is there any problem flashing the ND 4.2 build on a chip that has not implemented the ethernet hardware?
2) I would like to get a second set of eyes on the schematics before I build a prototype board. Is there someone interested in reading the schematic to catch my mistakes?
#43717 Multithreading and writing to SD card
Posted by AxelG on 19 January 2013 - 01:16 AM in Netduino Plus 2 (and Netduino Plus 1)
I have written a couple applications that have multiple threads accessing the SD card at the same time; it works but you need to be careful with a couple things. You hit on the first one; one thread per file (reading and writing). If you need two threads, simple locking mechanism can ensure read/seek/write transactions remain pure. Since each thread keeps their own file structures (Assuming you are not sharing them!); mostly you are OK.
I have also found that dealing with the SD card is quite resource intensive; especially when mixed with time-sensitive sensor reading. It is easy to create bottlenecks in the code that create data flow problems. Multi-threading on the netduino is not parallel processing; it just allows you to branch execution into separate places in your code - processor time is shared between the threads so only one instruction is running at a time. The right locking scheme can make all of the difference.
SD cards also use SPI. This is another area to make sure you code is aware there are multiple SPI devices.
#33219 multi threaded webserver
Posted by AxelG on 07 August 2012 - 01:29 PM in Netduino Plus 2 (and Netduino Plus 1)
I've attached the project. Any help much appreciated.
My ND+ is in use, so I could not run this code. Reading it, I suspect this {below} part of the code might be causing your trouble. From what I can gather in reading the source, this code gets called once to start flashing, and then again to stop flashing. That will create two threads for blinky: once when it gets the "on" command, and then creates a new thread when it gets the "off" command. I suspect that the "off" command does kill the thread started by the "off" command, but the "on" command thread is still running. If you look at the debugger output, you can see when the threads terminate to verify; compare that to when new threads start.
Look for something like the following: "The thread '<No Name>' (0x14) has exited with code 0 (0x0)." in your debug output.
One way to deal with this is to use managed threads and then you can tell which threads are running. {great way to learn about thread pools!} An alternative is to store the state of blinky in a static variable in main() so you can do two things: 1) make sure two "on" commands are not called without first calling an "off", 2) verify blinky is running before you try and kill it. (This will also require that blinkyobject be declared as static in main() as well so you can kill in one thread what was started in another)
[Disclaimer: There will be various opinions as to the best solution; I am just suggesting a couple that come to mind at the moment ]
Happy blinking! I hope this blurb helps get this solved for you.
case "flashled": { bool state = (e.Command.Arguments[0].Equals("on") ? true : false); { blinky blinkyobject = new blinky(); Thread blinkythread = new Thread(blinkyobject.blinkygo); if (state == true) { Debug.Print("blinky start"); blinkythread.Start(); e.ReturnString = "<html><body>You called FlashLed with argument: " + e.Command.Arguments[0].ToString() + "</body></hmtl>"; } if (state == false) { //Debug.Print("blinky stop"); blinkyobject.RequestStop(); Thread.Sleep(500); blinkythread.Join(); Debug.Print("main thread: Worker thread has terminated."); e.ReturnString = "<html><body>You called FlashLed with argument: " + e.Command.Arguments[0].ToString() + "</body></hmtl>"; } }
#33169 multi threaded webserver
Posted by AxelG on 06 August 2012 - 03:09 PM in Netduino Plus 2 (and Netduino Plus 1)
... So I did. But when I run blinkythread.abort
it throws an exception. Maybe I'm going about it all the wrong way. What I'm hoping to achieve is to be able to send a get
request through a browser like http://ipaddress/setbath/36 .
Hi Grant:
Maybe instead of just aborting the thread you could signal the Blinky thread to shutdown more gracefully. One way is to set up a simple event and trigger that event from your main code. This way the Blinky thread will close and perform any cleanup. You could put a timeout waiting for that thread to end before forcing the abort. Also, make sure the thread is still alive before calling the abort.
This tutorial may be helpful: Events
And this one on threading: Threading
Both of these helped me understand .NET threads and events.
#47341 Watchdog: How to do on netduino?
Posted by AxelG on 18 March 2013 - 06:49 PM in General Discussion
I have an extra board;happy to send it along... Just PM me.
#46645 Watchdog: How to do on netduino?
Posted by AxelG on 05 March 2013 - 01:08 AM in General Discussion
I have designs and plans to build a hardware watchdog you can use on a breadboard. It is based on the MAX6373 chip.
I have posted the designs in another thread, or I can build one for you if you are interested.
#44747 Netduino Plus 2 Firmware v4.2.2 (update 1)
Posted by AxelG on 02 February 2013 - 04:03 AM in Netduino Plus 2 (and Netduino Plus 1)
Update went well, but now I am seeing a quirky problem reading from the SD card. The following code hangs on the "while (reader.Peak())" line. Stepping through the debugger looks like it is stuck in a loop... Here is the code. The file on the SD card has 10 lines of ascii data.
ArrayList PortList = new ArrayList(); using (StreamReader reader = new StreamReader(PortFileName)) { while (reader.Peek() > 0) { HoldPort = new MCUPort(reader.ReadLine()); HoldPort.State = 1; HoldPort.LastState = DateTime.Now; PortList.Add(HoldPort); } }
#44802 Netduino Plus 2 Firmware v4.2.2 (update 1)
Posted by AxelG on 03 February 2013 - 03:01 AM in Netduino Plus 2 (and Netduino Plus 1)
Thanks to Lunddahl and T!!
i also found that EndOfStream property is not set until AFTER the first access!!! Before that it always reads "true". If I use Peak() after opening the stream, and then change my while loop looking at EndOfStream it seems to work.
I will try looking at the solution T provided. Thanks for your help!!
#33180 Camera Modules for any Netduino
Posted by AxelG on 06 August 2012 - 09:38 PM in Netduino Plus 2 (and Netduino Plus 1)
Ok! Thank
I can confirm that these drivers work very well. Easy to use and bug free (so far ) I trimmed them up a bit as I did not need all of the features written in the driver. Took me about a hour to get everything hooked up and running.
You must also have a ND with a SD card to use the drivers. That means either a ND+ or ND flashed to 4.2 and a SD shield of some kind. If you use the latter, you will have to add the mount and unmount commands to the driver.
Hope you enjoy; I know I did!
#33402 Camera Modules for any Netduino
Posted by AxelG on 11 August 2012 - 05:35 AM in Netduino Plus 2 (and Netduino Plus 1)
Maybe you could update the driver to send data out a serial port to some receiving system as it is read from the camera. You could get fancy and maybe perform a post to a waiting web server; assuming you have an Ethernet or wifi shield.I have NGO and no SD card yet
#33383 Debugging Assemblies loaded via Reflection
Posted by AxelG on 10 August 2012 - 06:24 PM in General Discussion
Yes, one project is what you have today (Production) and one new one (debug) that just references the library as a standard .dllYou have 2 projects and the ND startup is 'referencing' your library?
Your deployment grabs the library project and loads it to the flash chip? How are you referencing the library at this point? Standard reference or reflection?
Standard reference, just like any other .dll you include. Yes, at deploy time the .dll will be sent to the flash at the same time as your exe because it is just another .dll.
(At the risk of confusing the issue: an alternative approach might be..)
To make it easier to code, another alternative is to add a "library" subdirectory in this new (call it debug) project and add your library source as links into this subdirectory. That way the compiler knows to recompile the changed "library" code along with your program on any changes at build time. This way you are not dealing with two projects (one to build the dll and one to build your debug program) The downside is that you have to manage "who is calling who" to make sure you don't break your dll by referencing something that will become out of scope in your production build.
Nothing different. I am sure you are doing this now. I just load the assembly and call the starting method.What exactly are you doing here differently in your calling startup assembly?
#33882 Diagnosing slow deployment with VMware using WinUSB
Posted by AxelG on 18 August 2012 - 11:20 PM in General Discussion
#33874 Announcing: .NET MF 4.2 upgrade for all Netduino hardware
Posted by AxelG on 18 August 2012 - 04:55 PM in General Discussion
#33885 Diagnosing slow deployment with VMware using WinUSB
Posted by AxelG on 19 August 2012 - 04:28 AM in General Discussion
#33378 Debugging Assemblies loaded via Reflection
Posted by AxelG on 10 August 2012 - 04:17 PM in General Discussion
- Netduino Forums
- → AxelG's Content
- Privacy Policy