Looking for help writing a plug in for arduino interface (1 Viewer)

markcar_2000

Portal Pro
July 7, 2009
94
1
45
new york
Home Country
United States of America United States of America
first off if im posting in the wrong place sorry
Im looking for someone to work with me on a plugin to work with arduino microprocessor. Im pretty good at fabrication and im looking to make a settop box. but i keep getting lost when it comes to the code side. i can get the arduino to do what i want and make the hardware but the windows code is so far over me i Can't even start even the instructions seem to be in greek. Not that it matters but im it upstate ny and im willing to make the prototype bourd and send it to who ever is helping me and as we make headway and i get the parts ill do it in twos so all the hardware is the same ( don't get me wrong im not building anyone a hole pc just the case) anyone who's really interesting in helping me just respond and we will go from the. This is not going to be a over night project i can work up to 60 hours some weeks so slow and steady
 

Edalex

Community Plugin Dev
  • Premium Supporter
  • January 3, 2008
    2,955
    1,264
    Saratov
    Home Country
    Russian Federation Russian Federation
    Are you sure you need to code and it's impossible to apply already existing software?
    Also you didn't describe what knowleges you need (MP GUI plugin coding, windows service coding, drivers coding).
    So maybe you find someone with specific skills. I can give you some advices in MP plugins coding but I can't help you with coding myself since my attention diveded already with so many projects, sorry. :(
     

    markcar_2000

    Portal Pro
    July 7, 2009
    94
    1
    45
    new york
    Home Country
    United States of America United States of America
    Thanks for the response. my lack of codeing is so bad I don't know what i need. its not like it will cost me much to start makeing the box so maybe ill post as i go and any info or ideas when what im trying to do is clearer would be great. And if life stop this no lost then
     

    Lightning303

    MP Donator
  • Premium Supporter
  • September 12, 2009
    798
    577
    Home Country
    Germany Germany
    What is the idea? What does the arduino and the rest of the hardware even do? Sorry, but i dont even have an idea what you want a plugin for, so its quite hard to get interested.
     

    markcar_2000

    Portal Pro
    July 7, 2009
    94
    1
    45
    new york
    Home Country
    United States of America United States of America
    I know im bad at getting things out. I want to make a micro atx case with all the buttons and display of a settop box. Making the box and all is easy for me. I can get the arduino to print anything to the com port and read from the com port. So i programed it to send all the ir codes over the com port but from there im lost. There's already a driver so thats all good.
     

    JimCatMP

    Documentation Group
  • Team MediaPortal
  • April 1, 2010
    652
    283
    Leeds
    Home Country
    United Kingdom United Kingdom
    Still not 100% clear on what you want the Ardunio based element to do (mine handles touch based power switch {no mechanical switch:-}, LED displays {neopixel 12 RGB ring unit - power/disk and 'touch switch visual indicator'}, internal termperature monitor & PWM fan control - so it's part of PC control but has no MePo elements:).

    Suggest looking at :

    https://www.team-mediaportal.com/extensions/input-output/eventghostplus {suspect Is the best match}

    and

    https://www.team-mediaportal.com/extensions/mpdisplay/mpdisplay-extended-display-touchscreen-plugin

    What you need may already be covered in plugin terms.

    TTFN - JCMP.
     

    markcar_2000

    Portal Pro
    July 7, 2009
    94
    1
    45
    new york
    Home Country
    United States of America United States of America
    OK I'm still playing with this idea. right now i have a Arduino pro micro witch can be set up a H.I.D keyboard/mouse and it is tied in to a old remote i had for my hauppauge tuner card. i attached the code if any one wants to play with it. It will only work with the Arduino pro micro or the Arduino Leonardo. right now it does most of the things my i-mon does in the processes of decode the Antec Veris RM 200 witch has 58 buttons so it will be a lot more useful with controlling thing outside of mediportal like lights and what not i have a harmony 890 remote so i can move the buttons around for a better layout. theirs a relay attached to this to set the PC in to sleep or restart.

    Still not 100% clear on what you want the Ardunio based element to
    TTFN - JCMP.

    I want to control it with the remote directly "not a big deal works now with keyboard short cuts" and want to be able to control things from inside Mediportal like blinds, lights,ect and i want to be able to see data from sensors like temp wind speed, ect
     

    Attachments

    • MP_RRS9002.86XF.rar
      2.1 KB

    hurley

    Portal Pro
    February 2, 2015
    61
    57
    Home Country
    Australia Australia
    Those HID keyboard/mouse Arduino's should be plug'n'play just like similar remotes as far as controlling MP goes.
    It sounds like you're most of the way there if you've got your Arduino controlling external stuff via relays and the like with remote input.

    Now you want a nice GUI within MediaPortal with some buttons to control stuff via your Arduino ... ?

    Part 1
    1.
    You need to create some command codes that map to functions which your Arduino can control.
    2. Set up your Arduino to monitor the serial port for these commands in the main loop.
    3. When a recognised command is received -> Arduino performs the action.

    Part 2
    You want a MP GUI or 'Window' plugin for this. Start with a basic one with a couple of buttons to get you started.
    These pages should have everything you need to get this up and running:

    MediaPortal Wiki > MediaPortal 1 > Contribute > Plugins
    MediaPortal Wiki > MediaPortal 1 > Contribute > Plugins > Plugin Developer's Guide > Develop a Plugin

    Once that's up and running you'll need to instantiate a serial port object, set the port that your Arduino is connected to and open the serial port.
    ref: System.IO.Ports.SeriaPort
    Code:
    System.IO.Ports.SerialPort sp1 = new System.IO.Ports.SerialPort("COM1");
    sp1.Open();


    When you get to this part: Performing an action when a MP button is pressed. Use your Serial Port object to send your command to the Arduino.
    Code:
    protected override void OnClicked(int controlId, GUIControl control, Action.ActionType actionType)
    {
      if (control == buttonOne)
      OnButtonOne();
      if (control == buttonTwo)
      OnButtonTwo();
      base.OnClicked (controlId, control, actionType);
    }
        
    private void OnButtonOne()
    {
      sp1.Write("your special command code");
    }
        
    private void OnButtonTwo()
    {
      //...
    }


    Take a look at MediaPortal's built in Window Plugins for an example of how write your own:
    https://github.com/MediaPortal/MediaPortal-1/tree/master/mediaportal/WindowPlugins
    And google for user friendly guides on using the serial port.

    Hope that help's get you started and doesn't scare you off.
    Good luck with your project, it sounds like a great idea! :)
     

    Users who are viewing this thread

    Top Bottom