Quantcast
Channel: Objective Development Forums
Viewing all 4524 articles
Browse latest View live

Re: Introduction for beginners!

$
0
0
Maybe you want also to read http://www.beyondlogic.org/usbnutshell/usb1.shtml ?

In VUSB communication via host often is done by just using the control endpoint - the endpoint also responsible for communication
device descriptor and strings (vendor, type, serial ...) to the host.

For tinyUSBboard I prepared some VUSB template, some time ago.
You can find it as "VUSB skeleton/example with corresponding linux, windows (delphi) and platform independent GTK libusb program"
at http://matrixstorm.com/avr/tinyusbboard/#examples

Re: Instant Send and Quickey for Launchbar stop working

$
0
0
Has there been any progress on this. To get it working again requires a restart. just quitting the app isn't good enough. The functions affected are the two main functions I use Launchbar for.

Basic setup for tethered laptop to prevent huge data bills

$
0
0
A friend wants me to help set up his new MBP, which he will regularly use tethered to his iPhone as well as on his home WiFi network.

Exceeding data limits on mobile contracts is very costly in Australia. Little Snitch sounds like the easiest way to stop this (especially with auto profile switching), but I can't find much in the way of guides for non-power users about how to set it up. To be very clear: I'm not interested if Little Snitch can monitor every piece of data going in and out - I just want to ensure there aren't any unexpected big transfers whilst connected to his iPhone's Personal Hotspot.

I want his computer to function as normal when connected to any WiFi network except on nominated networks such as his iPhone, where I want to ensure that nothing unexpected causes a big download (e.g., system updates, automatic app updates, iTunes Match, etc, etc). Minimising pop ups in both situations is absolutely critical, otherwise he'll just uninstall it.

In his day-to-day work he mainly uses Dropbox, Safari (including Gmail), possible Evernote and Office apps. At home he uses MOG, Transmission, and no doubt quite a few other apps that he won't need when tethered to his phone.

Can anyone point me to a good basic guide, or provide an overview of how to approach setting this up?

Bonus points: for my own interest (possibly going to get a MBP pro as a supplement to my iMac workhorse) any advice on setting LS up to deal with Dropbox where you want to be able to access any specific file that you need, but don't want to unwittingly sync enormous Photoshop files added by a third party to a shared folder. i.e. basically how the iOS dropbox app functions, not how the OSX one does.

Re: Found a New site:FFXIVGILlive.com

$
0
0
I've googled and seen reference to a safari plugin but I can't find it.

Re: Found a New site:FFXIVGILlive.com

$
0
0
I've googled and seen reference to a safari plugin but I can't find it.


__________
adem
(in post)

Re: VAT ID??!

$
0
0
Well... nice to know in advance that "support" here is pretty much NON-EXISTENT. Seeing how many threads have ZERO responses and how many of the actual responses are even from someone Objective Development... NOT.

Bravo. Looks like I'm off to the HandsOff site, seeing that apparently no one here is interested in my money. Thanks for nothing.

Re: Introduction for beginners!

$
0
0
I knew nothing of usb and had very little firmware programming experience when I started on v-usb. I only needed two things, 1) example code 2) this form.

Re: Introduction for beginners!

$
0
0
Similar here. I've found the guides hopelessly disorganized, presenting random details and commentary before the reader even understands the overall structure. Along the lines of example code being a good teacher, I'd love to see a log of an actual USB session for say a keyboard, describing each USB event, and what v-usb does internally to respond. Not a tiny snapshot of it, but the whole session, so one can see how it all fits together. That would move me forward on my USB understanding far more than anything else. Concrete examples. And with timing information!

hidtool works on Linux, does not work on Windows 7

$
0
0
Hello,
I made a device based on the hid-data demo. It works great on Linux (tested on two machines), but hidtool read fails on Windows 7 64-bit (also tested on two different machines other then the Linux ones):
error reading data: Communication error with device

When I unplug it hidtool returns device not found.
The device is correctly enumerated and shown in device manager without warnings.
Hardware itself is not faulty, as I successfully used bootloadHID to upload new firmware in Windows 7.

The main.c:
/* Name: main.c
 * Project: hid-data, example how to use HID for data transfer
 * Author: Christian Starkjohann
 * Creation Date: 2008-04-11
 * Tabsize: 4
 * Copyright: (c) 2008 by OBJECTIVE DEVELOPMENT Software GmbH
 * License: GNU GPL v2 (see License.txt), GNU GPL v3 or proprietary (CommercialLicense.txt)
 */

//demo modified by SP2AGX for yaesu antenna switch

/*
This example should run on most AVRs with only little changes. No special
hardware resources except INT0 are used. You may have to change usbconfig.h for
different I/O pins for USB. Please note that USB D+ must be the INT0 pin, or
at least be connected to INT0 as well.
*/

#include <stdlib.h>
#include <avr/io.h>
#include <avr/wdt.h>
#include <avr/interrupt.h>  /* for sei() */
#include <util/delay.h>     /* for _delay_ms() */
#include <avr/eeprom.h>
#include <avr/pgmspace.h>   /* required by usbdrv.h */
#include "usbdrv.h"

/* ----------- application specific defines --------- */
#define LED_PTT_ON()   PORTD&=~_BV(PD4)
#define LED_PTT_OFF()  PORTD|=_BV(PD4)
#define LED_MODE_ON()  PORTB&=~_BV(PB5)
#define LED_MODE_OFF() PORTB|=_BV(PB5)
#define NO_PTT PINC&_BV(PC1)
#define MODE_BUTTON_UP PINB&_BV(PB4)
#define MODE_BUTTON_DOWN !(PINB&_BV(PB4))
#define MODE_AUTO 1
#define MODE_MANUAL 0
/* ----------- runtime variables -------------------- */
//number of samples to average
#define ADC_SAMPLES_MAX 16
//there are 7 buttons, button 0 means none pressed (8 possible input states)
#define BUTTONS_N 8
unsigned char volatile adc_values[ADC_SAMPLES_MAX];
unsigned char volatile adc_index=0;
unsigned char volatile process_keys=0;
unsigned char volatile demanded_antenna=1;
unsigned char volatile selected_antenna=0;
unsigned char volatile operation_mode=MODE_AUTO;
/* ----------- EEPROM variables --------------------- */
#define BAND_COUNT 17
unsigned char ee_band_antenna[BAND_COUNT] EEMEM;

//done: ports initialization
//done: driver control
//done: radio interfacing + PTT lock
//done: key sampling
//done: memory reset
//done: EEPROM programming
//done: USB routines

//prototypes
void switch_antenna(unsigned char n);
inline unsigned char get_band_input();
unsigned char get_button_pressed();

/* ------------------------------------------------------------------------- */
/* ----------------------------- USB interface ----------------------------- */
/* ------------------------------------------------------------------------- */

PROGMEM const char usbHidReportDescriptor[22] = {    /* USB report descriptor */
    0x06, 0x00, 0xff,              // USAGE_PAGE (Generic Desktop)
    0x09, 0x01,                    // USAGE (Vendor Usage 1)
    0xa1, 0x01,                    // COLLECTION (Application)
    0x15, 0x00,                    //   LOGICAL_MINIMUM (0)
    0x26, 0xff, 0x00,              //   LOGICAL_MAXIMUM (255)
    0x75, 0x08,                    //   REPORT_SIZE (8)
    0x95, 0x10,                    //   REPORT_COUNT (16) changed!!!!!!!
    0x09, 0x00,                    //   USAGE (Undefined)
    0xb2, 0x02, 0x01,              //   FEATURE (Data,Var,Abs,Buf)
    0xc0                           // END_COLLECTION
};
/* Since we define only one feature report, we don't use report-IDs (which
 * would be the first byte of the report). The entire report consists of 128
 * opaque data bytes.
 */

/* The following variables store the status of the current data transfer */
//static uchar    currentAddress;
//static uchar    bytesRemaining;
//static uchar    page_flag=0;

/* ------------------------------------------------------------------------- */


/* usbFunctionRead() is called when the host requests a chunk of data from
 * the device. For more information see the documentation in usbdrv/usbdrv.h.
 */
uchar   usbFunctionRead(uchar *data, uchar len)
{

  data[0]=operation_mode;
  data[1]=selected_antenna;
  data[2]=demanded_antenna;
  data[3]=get_band_input();
  data[4]=get_button_pressed();
  data[5]=ADCH;
  data[6]=NO_PTT;
  data[7]=0;
  return 8;
}

/* usbFunctionWrite() is called when the host sends a chunk of data to the
 * device. For more information see the documentation in usbdrv/usbdrv.h.
 */
uchar   usbFunctionWrite(uchar *data, uchar len)
{
  if (data[0]=='M'){ // 0x4D
    if (data[1]==1){ //switch to manual mode
      operation_mode=MODE_MANUAL;
      demanded_antenna=data[2];
      switch_antenna(demanded_antenna);
    }
  } else if (data[0]=='A'){// 0x41
    operation_mode=MODE_AUTO;//return to auto mode
  }
    return 1;
}

/* ------------------------------------------------------------------------- */

usbMsgLen_t usbFunctionSetup(uchar data[8])
{
usbRequest_t    *rq = (void *)data;

    if((rq->bmRequestType & USBRQ_TYPE_MASK) == USBRQ_TYPE_CLASS){    /* HID class request */
        if(rq->bRequest == USBRQ_HID_GET_REPORT){  /* wValue: ReportType (highbyte), ReportID (lowbyte) */
            /* since we have only one report type, we can ignore the report-ID */
       //page_flag=0;
            return USB_NO_MSG;  /* use usbFunctionRead() to obtain data */
        }else if(rq->bRequest == USBRQ_HID_SET_REPORT){
       //page_flag=0;
            /* since we have only one report type, we can ignore the report-ID */
            return USB_NO_MSG;  /* use usbFunctionWrite() to receive data from host */
        }
    }else{
        /* ignore vendor type requests, we don't use any */
    }
    return 0;
}

/* ------------------------------------------------------------------------- */
//switches the selected antenna relay if not blocked by PTT
void switch_antenna(unsigned char n){
  if (NO_PTT){ // PTT not active
    if (selected_antenna!=n){ //if there is any need to change
      PORTD&=~(_BV(PD5)|_BV(PD6)|_BV(PD7));          //all antennas
      PORTB&=~(_BV(PB0)|_BV(PB1)|_BV(PB2)|_BV(PB3)); //    off
      switch(n){
        case 1:PORTB|=_BV(PB1);break; //PB1
        case 2:PORTB|=_BV(PB2);break; //PB2
        case 3:PORTB|=_BV(PB3);break; //PB3
        case 4:PORTB|=_BV(PB0);break; //PB0
        case 5:PORTD|=_BV(PD7);break; //PD7
        case 6:PORTD|=_BV(PD6);break; //PD6
        case 7:PORTD|=_BV(PD5);break; //PD5
      }
    selected_antenna=n;
    }
  }
}
/* ------------------------------------------------------------------------- */
//returns the selected band from transceiver output
inline unsigned char get_band_input(){
  return (PINC>>2)&0xF; //read the inputs, shift to lower the value and mask high bits
}

/* ------------------------------------------------------------------------- */
//averages ADC samples and picks the most likely pressed button
unsigned char get_button_pressed(){
 uint16_t error_table[BUTTONS_N];
 unsigned char max_adc=0,min_adc=255;
 unsigned char i;
 unsigned char adc_value_avg;
 static const unsigned char perfect_value[]={0, 0xFF, 0xDB, 0xB6, 0x91, 0x6D, 0x48, 0x24 };//zero is simply lack of keys, constant pulldown resistor
 unsigned min_err=0xFFFF,min_err_i=0; //by default assume no key pressed
 
  for (i=0;i<ADC_SAMPLES_MAX;i++){
    if (adc_values[i]>max_adc){ max_adc=adc_values[i]; }
    if (adc_values[i]<min_adc){ min_adc=adc_values[i]; }
  }
 
  if (max_adc-min_adc < 10 ){ //all ADC values look stable, 10 is just a magic number
    adc_value_avg=((uint16_t)max_adc+min_adc)/2;
 
    for (i=0;i<BUTTONS_N;i++){ //compute differences between ADC and perfect key values for each key
      if (adc_value_avg>perfect_value[i]){ //prevents underflow at zero
   error_table[i] =  adc_value_avg - perfect_value[i];
      } else {
   error_table[i] =  perfect_value[i] - adc_value_avg;
      }
    }
   
    for (i=0;i<BUTTONS_N;i++){ //pick the smallest error
      if (error_table[i]<min_err) {
   min_err=error_table[i];
   min_err_i=i;
      }
    }
  }
  return min_err_i;
}
/* ------------------------------------------------------------------------- */
//reset to defaults, then halt
void memory_reset(){
   unsigned char i=0;
   for (i=0;i<BAND_COUNT ;i++){
     eeprom_busy_wait();
     eeprom_write_byte(&ee_band_antenna[i],1);
   }
   LED_MODE_ON();
   LED_PTT_ON();
   PORTD|=_BV(PD6);//some extra leds
   PORTD|=_BV(PD5);
   while (1){
      cli();
      wdt_reset(); //endless loop, wait for power cycle
   }
 
}
/* ------------------------------------------------------------------------- */
int main(void)
{

  wdt_reset();
  wdt_enable(WDTO_1S);

    /* Even if you don't use the watchdog, turn it off here. On newer devices,
     * the status of the watchdog (on/off, period) is PRESERVED OVER RESET!
     */
    /* RESET status: all port bits are inputs without pull-up.
     * That's the way we need D+ and D-. Therefore we don't need any
     * additional hardware initialization.
     */

    usbInit();
    usbDeviceDisconnect();  /* enforce re-enumeration, do this while interrupts are disabled! */

    /* ----- ADC configuration ----- */
    ADMUX = _BV(REFS0)|_BV(ADLAR);//multiplexed button input ADC0, Aref=AVCC+cap, 8-bit left adjust
    ADCSRA = _BV(ADEN) | _BV(ADPS2) |  _BV(ADPS1) | _BV(ADPS0) | _BV(ADSC); //93kHz ADC clock, interrupt enable, start conversion

    /* ----- pins configuration ----- */
    PORTC|=_BV(PC1)|_BV(PC2)|_BV(PC3)|_BV(PC4)|_BV(PC5); //PTT and band input pullup
    DDRD|= _BV(PD4)|_BV(PD5)|_BV(PD6)|_BV(PD7); //PTT_LED and relay driver output
    DDRB|= _BV(PB0)|_BV(PB1)|_BV(PB2)|_BV(PB3)|_BV(PB5); //MODE_LED and relay driver output
    LED_MODE_OFF();
    LED_PTT_OFF();
    PORTB|=_BV(PB4); //mode button input pullup

    /* ---timer configuration for key sampling --- */
    TCCR0 = _BV(CS02); // 256 prescaling, ~180Hz interrupt rate
    TIMSK = _BV(TOIE0);
   
    loop_until_bit_is_set(ADCSRA,ADIF);//wait for the first ADC conversion
    if (ADCH>200){
      memory_reset();
    }
    ADCSRA |= _BV(ADIE); //enable ADC interrupt
   
    unsigned char i = 0;
    while(--i){             /* fake USB disconnect for > 250 ms */
        wdt_reset();
        _delay_ms(1);
    }
    usbDeviceConnect();
    sei();
   
    for(;;){                /* main event loop */
        wdt_reset();
        usbPoll();

   if (process_keys){ //slow processing loop, ~180Hz rate
     process_keys=0;
     unsigned char button=get_button_pressed();
    
     if (button){ //any button pressed
       if (MODE_BUTTON_DOWN){ //memory programming
         eeprom_busy_wait();
         eeprom_write_byte(&ee_band_antenna[get_band_input()],button);
         eeprom_busy_wait();
         operation_mode=MODE_AUTO;
       } else {      //regular manual switch
         operation_mode=MODE_MANUAL;
         demanded_antenna=button;
       }
     }
    
     if (operation_mode==MODE_AUTO){
       demanded_antenna=eeprom_read_byte(&ee_band_antenna[get_band_input()]); //retrive the programmed antenna from eeprom
       LED_MODE_ON();
     } else {
       LED_MODE_OFF();
     }
    
     if (MODE_BUTTON_DOWN){
       operation_mode=MODE_AUTO;
     }
   }

   if (NO_PTT){
     LED_PTT_OFF();
   } else {
     LED_PTT_ON();
   }
   
   switch_antenna(demanded_antenna);
    }
    return 0;
}

/* ------------------------------------------------------------------------- */
//key sampling interrupt

ISR (TIMER0_OVF_vect, ISR_NOBLOCK){ //interrupt should be interruptable
  TIMSK &= ~_BV(TOIE0);//disable timer interrupt
  ADCSRA |= _BV(ADSC); //start next conversion
}

ISR (ADC_vect, ISR_NOBLOCK){ //interrupt should be interruptable
        adc_values[adc_index]=ADCH; //store current value
   adc_index++;
   if (adc_index==ADC_SAMPLES_MAX){
     adc_index=0;
     process_keys=1;
   }
   TCNT0 = 0; //reset delay timer
   TIMSK |= _BV(TOIE0);//enable timer interrupt
}


I also tried changing REPORT_COUNT (16) back to defaults, though I've built a different device using an identical descriptor that actually works under Windows.

I did a communication dump using Wireshark:
http://sp2put.utp.edu.pl/~filo/yas/yas_usbdump.pcapng
The device is probably connected after packet 53.
I try to execute hidtool read at packet 77 and then again at packet 83.

The device itself is a little more described at http://sp2put.utp.edu.pl/index.php/2761,automatyczny-przelacznik-anten-do-yaesu-ft-950-z-usb?lang=en

Need help identifying unreported net traffic.

$
0
0
Running 10.9.1 and latest LS.

I have the Network Monitor running, and it reports little, if any net traffic.

But I also use a program called XResource Graph, that monitors net traffic and reports a constant stream of 476-480K/s receiving.

In Activity Monitor mDNSResponder is receiving some packets: half a dozen every few seconds.
Overall, Activity Monitor reports receiving negligible amounts of incoming traffic: less than 100 bytes/sec.

Maybe it's a bug in XResource Graph. Are there any other known ways of finding traffic that LS and Activity Monitor might miss?

Re: hidtool works on Linux, does not work on Windows 7

$
0
0
Everything also works perfectly under OS X Maverics.

MAC 10.9.1

$
0
0
I just installed an OS X update that was released today (maybe yesterday?) 18 Dec. When installing it told me that my current version of Little Snitch wouldn't work with the update. I am currently running Little Snitch 3.3 that I installed mid Oct. After rebooting I started Little Snitch and it 'seems' to be working. Anyone know what might be going on?

r/dell

Re: Using with CloakBox ProVPN

$
0
0
Just ordered CloakBox Pro VPN router. Since this is a router, rather than VPN s/w config, will Little Snitch work without these suggested VPN configurations?

Re: MamePanel

$
0
0
it work on win without problem, but no in linux, dmesg don't show none hid device registered, maybe because the double device description? someone can point me in the direction to patch the kernel module to make it work?

Editing default templates

$
0
0
Hi,

Over the years, I made the mistake of adding search templates to default sets. The default sets have also changed over the years. If it were possible to drag and drop templates between sets, I could then delete the old defaults and re-add them. Any chance?

Re: hidtool works on Linux, does not work on Windows 7

$
0
0
I figured out that the only change in hidtool.c I made is at line 94 - I decreased buffer size to print just 8 bytes (they wrap around at the device anyway). I reverted back to 129 bytes as in the stock demo and now it works on Windows. I still don't get why it worked modified on Unixes.

Re: Little Snitch behaviour

$
0
0
I am having the same issue on osx 10.9 and LS 3.3.1 . I solve it by stopping and starting network filter from the toolbar.
This is definitely making LS unusable for me.

Michael

Re: Allow all connections for an OS X Guest Account?

$
0
0
I'm wondering how to do the same thing.

Re: Copy 1Password content from LaunchBar?

Re: Application Not Responding

$
0
0
Same Here!

I'm on OS 10.8.5 and just upgraded to 3.3 and could not open either Preferences or Rules - the infamous beach ball of death appears whenever doing so

I tried reinstalling v3.3 a few times to no avail and then tried installing the nightly build v3.3.1 a few times to no avail.
I checked the system Activity Monitor and found that there are Two Instances of "Little Snitch Agent" running - each consuming 20-30% of system resources at any given time (without trying access Preferences or Rules.
I tried force quitting one of the Little Snitch Agents but a new second Little Snitch Agent auto loads each time.

At this point,
- LS network monitoring is working properly,
- I cannot launch Preferences or Rules without LS hanging up.

R
Viewing all 4524 articles
Browse latest View live