Netduino home hardware projects downloads community

Jump to content


The Netduino forums have been replaced by new forums at community.wildernesslabs.co. This site has been preserved for archival purposes only and the ability to make new accounts or posts has been turned off.

hanzibal's Content

There have been 386 items by hanzibal (Search limited from 29-March 23)


By content type

See this member's


Sort by                Order  

#58076 Networked music player using the mini

Posted by hanzibal on 12 May 2014 - 06:36 PM in Project Showcase

The 16 bit register is divided into two bytes of 8 bits (256 steps) each, you need to set the two bytes separtely like so:

byte left_vol = 45;
byte right_vol = 90;

ushort vol = (left_vol << 8) + right_vol;

WriteRegister(REG_SCI_VOL, vol);



#57936 MIP tcp/ip stack running on Netduino mini !!

Posted by hanzibal on 04 May 2014 - 06:28 PM in Project Showcase

I'm sorry for not being of much help here but I've never dealt with that M2Mqtt.

 

Did you solve the problem eventually?




#57935 Networked music player using the mini

Posted by hanzibal on 04 May 2014 - 06:17 PM in Project Showcase

SCI_VOL is a h/w register of the vs1053b chip, so you need to write the value 0x2424 to the register. You do this using the serial command interface (hence the "SCI" prefix) over SPI.

    // Write to an  SCI register
    private void WriteRegister(byte address, ushort data, bool waitForDREQ = true)
    {
        wr_buff[0] = 2;                    // write command
        wr_buff[1] = address;              // register
        wr_buff[2] = (byte)(data >> 8);    // high byte
        wr_buff[3] = (byte)(data & 0xff);  // low byte

        SelectCommand();                   // select SCI
        if (waitForDREQ) AwaitDREQ();      // wait for dreq to go high
        spip.Write(wr_buff);
    }

    // example of setting volume
    WriteRegister(REG_SCI_VOL, 0x2424);

The code snippet above is taken from my source code (puplished earlier).

 

I would use a rotary encoder but if you want to use a potentiometer, you can set it up as a simple voltage divider GND - 3.3V and then read the voltage of the wiper using a Netduino analogue pin. You would then need to add software to continuously poll the analogue pin for any changes in voltage, executing the corresponding volume adjustments.




#57567 MIP tcp/ip stack running on Netduino mini !!

Posted by hanzibal on 14 April 2014 - 02:04 PM in Project Showcase

Great, looking forward too see the vid!



#57033 Gainspan WiFi module

Posted by hanzibal on 23 March 2014 - 07:15 PM in General Discussion

Progress has been extremely slow, it can scan and list SSIDs of available networks and also connect given the corresponding WPA2 key.

However, It can not do anything useful like accessing actual content on remote servers because of general problems reading and writing streams so there's little or no point in pblishing any code until I got those basics working.

There's probably as many recepies to writing drivers as there are chips to write them for but I think, In general the key is to read the d/s back and forth until you know your way in it, which sections contains which bits of information, where to find the info you need in various situations that you can anticipate.

Get the hang of the terminology used by the vendor and get a good feel for how the chip works and how you are supposed to use it. Ask your self the relevant questions, how can I achieve this or that required functionality and make sure you know where in the d/s the answers are.

Make up some kind of hypothetical API structure in your head and test it against what you have gathered from reading the d/s to see if your model is realistic and valid. Sometimes you can find some code for another architecture for inspiration or that you can port from but you will need to understand the chip nevertheless.

Proceed by establishing a working communication with the chip. Implement register read ops and verify by reading some expected power-on default value. Then get write ops working, verify using write and read-back testing. Write a value to some register and verify by reading back the register value to make sure it "stuck".

Come up with a programming model with some basic properties and methods supporting the model in your head. Create a class and definine the various constants, enums, register addresses and such that you will need.

Then start implementing, pick something simple like "getversion", "soft reset" or whatever is available, preferably something really simple that can be easily verified.

By now your knowledge and confidence will have grown enough to make the rest fall into place as if almost by itself.

Good luck!



#56818 Help with line of code (var rowNumber)

Posted by hanzibal on 15 March 2014 - 03:43 PM in Netduino 2 (and Netduino 1)

When cascading as depicted on page 13 of the d/s, you don't send data to a certain chip, instead you just clock out the data bits in a series out the MOSI line and into the shift register of each chip. When all bits are in place, you assert the load pin for all chips at once and each chip will load whatever command there is sitting in its shift register at that point.

Of curiosity, how come you need more than 16 digits?



#56817 Sine wave

Posted by hanzibal on 15 March 2014 - 01:55 PM in Netduino Plus 2 (and Netduino Plus 1)

There's not much info:
http://www.kjell.com...65-a2cf00ca0fb4

...but I got one so I could open it up and take som photos of the circuitry inside. Might be of help for seascan too.



#56811 Sine wave

Posted by hanzibal on 15 March 2014 - 07:45 AM in Netduino Plus 2 (and Netduino Plus 1)

That's interesting, but a metal detector works based on a different principle.
The AC detector is pretty simple: it detects the AC voltage leveraging a capacitive coupling. Since the voltage is high, even a small coupling will have a noticeable effect. All is tuned on the 50/60 Hz.

The device actually did both with three separate indicator LEDs for wood beams, metal beams and for cables carrying AC. Naturally, it was very simple and can't compare with an actual metal detector.



#56800 Sine wave

Posted by hanzibal on 14 March 2014 - 08:18 PM in Netduino Plus 2 (and Netduino Plus 1)

Recently, the local "radio shack" offered one of those wood/metal beam and AC detector units for only 5 dollars - you know, the kind of device used to find beams inside your walls. Maybe you could find a cheap one and hack it?



#56785 MIP tcp/ip stack running on Netduino mini !!

Posted by hanzibal on 13 March 2014 - 07:23 PM in Project Showcase

Sorry post to wrong thread.

When re-reading my last post I realized that I may have sounded grumpy and if so, I'm sorry because I didn't mean to.

You're doing a great job Andy and I'm glad you have taken interest in this. Please do make a new post in the MCP23S17 thread and I'll do my best to help you.



#56766 MIP tcp/ip stack running on Netduino mini !!

Posted by hanzibal on 12 March 2014 - 11:23 AM in Project Showcase

I'm sorry but I really think you should refrain from posting the entire listing in this thread, not just because it's really long but because it has very little to do with mIP.

Please modify your last post, remove the code and instead attach it as a file to the MCP23S17 thread. In that new post, please also point out any specific problems that you want me to look into.



#56729 Help with line of code (var rowNumber)

Posted by hanzibal on 09 March 2014 - 08:23 PM in Netduino 2 (and Netduino 1)

Those are the values assigned by default so it won't change anything.

Actually, the MAX 7219 and 7221 are 8 digit driver chips but they support daisy-chaining while the driver class apparently does not.

https://www.sparkfun...219-MAX7221.pdf

The solution is to modify the driver so that it supports cascading.



#56706 Netduino & RF transmitter to pair with and control smart electricity socket

Posted by hanzibal on 08 March 2014 - 11:52 AM in Project Showcase

Exactly, I see no hazards in what you're doing and naturally telemetry is harmless.

In my home, I got a networked IR gateway (iTach) for controlling all my A/V gear and built an RF bridge for controlling wall oulets like the ones you're using. I'm using my iPhone/iPad as a WLAN remote control but it only works within the domestic LAN.

http://www.avsforum....for-itach-irule



#56696 Netduino & RF transmitter to pair with and control smart electricity socket

Posted by hanzibal on 07 March 2014 - 03:59 PM in Project Showcase

Aha, I thought we were talking about remote controlling from within the LAN only.

I wouldn't have my gear connected to the internet accessible from the outside world.

In some home automation product broshures, manufacturers push for things like being able to control the lighting in your home from away on vacation in another country or perhaps starting your sauna from the car on the way home. Dangerous madness.



#56689 Automated Urban Garden

Posted by hanzibal on 07 March 2014 - 06:55 AM in Project Showcase

To think there are more than one manufacturer of such things, incredible really!



#56685 Automated Urban Garden

Posted by hanzibal on 06 March 2014 - 09:31 PM in Project Showcase

The SensorTag is just 25 dollars :-)

I got one, works perfecly with iOS devices but haven't got around getting a board for my Netduinos yet and turned out there's no BT LE drivers for my good old XP box (while as it is built into Win 7).



#56684 Netduino & RF transmitter to pair with and control smart electricity socket

Posted by hanzibal on 06 March 2014 - 09:22 PM in Project Showcase

One would think you were in control of what devices are accessing your local network?

At least I think I am - of mine, not yours, that is :-)



#56671 Automated Urban Garden

Posted by hanzibal on 06 March 2014 - 11:49 AM in Project Showcase

Great project!

If you need more sensors, you could try interfacing the Parrot Flower Power:
http://www.parrot.com/flowerpower/en/

It would require a Bluetooth LE module and probably hacking their protocol. The flower power is a bit expensive but there's also the SensorTag from Texas which is not miles away (not a coinsidence):
http://www.ti.com/tool/cc2541dk-sensor



#56670 Netduino & RF transmitter to pair with and control smart electricity socket

Posted by hanzibal on 06 March 2014 - 11:35 AM in Project Showcase

Sure it counts as a project, more than well!

I've done a fair deal of similar RF control stuff too and found it very rewarding.

Very interesting and great news!

I actually didn't think Netduino was fast enough for bit-banging this (not even Netduino 2) and thought you had at least use SPI for this.

The natural next step would be adding a webbserver so that you can use a smartphone as a remote control but I guess you already thought of that.



#56613 Help with line of code (var rowNumber)

Posted by hanzibal on 04 March 2014 - 12:35 AM in Netduino 2 (and Netduino 1)

Judging from the RegisterAddressMap enum, there seem to be an 8 digit limit to the driver.

The enum is conceptionally mistreated. They way they are defined, they are not meant for you to apply arithmetics operations onto them.

Surely, as the corresponding enum values just so happens to be 0,1,2,3...etc because of the order in which they appear, you consecuently happen to get "digit1" by adding a one to "digit0". However, when adding a one to "digit7" you suddenly get "DecodeMode" instead of "digit8" which is not defined.

See what I mean?



#56604 Extensive driver for the MCP23S17 I/O expander

Posted by hanzibal on 03 March 2014 - 08:58 AM in Project Showcase

Carrying the multi SPI conversation on here...
Do you think it is possible to incorporate Steffan's multi spi mgr in to your MCP23S17 driver?

Yes but can this really be achieved with mIP 100% unchanged?

Am I correct in saying the use of a bus is to allow for multiple port changes to be made in one write, thus increasing speed and efficiency?

If this is correct, then I also understand that I can't make a bus spanning multiple chips, however if for example I wanted to change the state of 10 pins 5 on each chip, then I could create a class that identifies which pins are on which bus and perform 2 writes one for each bus?

Both correct and the best way to do this is probably for you to wrap the driver in another class of your own.



#56590 MIP tcp/ip stack running on Netduino mini !!

Posted by hanzibal on 02 March 2014 - 10:30 PM in Project Showcase

Great!

As for multi SPI, I could make an interface for the internal multi SPI mgr implementation of my MCP23S17 driver and expose that from outside the class.

You would then have to make some modificatins to your local mIP code to have it use the interface supplied by me rather than accessing the SPI module directly.

The latter would probably only be a little more than search and replace but still, you would break away from the main track of mIP. This is what I meant before when talking about the lack of a standard multi SPI mgr that can be shared between code originating between different contributors.

EDIT: Just discovered, mIP also includes a multi SPi mgr (borrowed from Stefan Thoolen's Toolbox)...



#56588 MIP tcp/ip stack running on Netduino mini !!

Posted by hanzibal on 02 March 2014 - 09:59 PM in Project Showcase

Good job!

 

I guess it's sort of a bug but mostly because mIP hasn't been tested with all that many routers yet  :)

 

If you haven't already, could you please report your findings on the mIP CodePlex site  or perhaps send a personal message about it Valkyrie-MT briefly describing the problem, what you did to fix it and the name/model of your router?

 

So I take it, you got TCP/IP up and running now then - that's great!




#56572 MIP tcp/ip stack running on Netduino mini !!

Posted by hanzibal on 02 March 2014 - 08:40 AM in Project Showcase

It seems name servers does not get configured correctly via DHCP with MIP even though there is one in your network.

Perhaps ns info somehow gets garbled after all - maybe you could debug the method that printed the ns info earlier and see if it is actually stored like that, e.g. if in fact MIP thinks that "192.168.1.1.192.168.1.254" is the configured ns - if so, there could be some problems with string handlng during DHCP processing.



#56564 How to convert hex value stored in string to binary in string?

Posted by hanzibal on 01 March 2014 - 09:11 PM in Visual Studio

The latter direction, Number.ToString("x2") should work.

Might be possible to use something like int.Parse(...) in the other direction?




home    hardware    projects    downloads    community    where to buy    contact Copyright © 2016 Wilderness Labs Inc.  |  Legal   |   CC BY-SA
This webpage is licensed under a Creative Commons Attribution-ShareAlike License.